Re: Re: cvs: php-src(PHP_5_3) / run-tests.php
| From: | Jani Taskinen | Date: | Tue, 09 Dec 2008 11:09:33 +0000 |
| Subject: | Re: Re: cvs: php-src(PHP_5_3) / run-tests.php | ||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-54792@lists.php.net to get a copy of this message | ||
Hannes Magnusson wrote:
On Tue, Dec 9, 2008 at 10:15, Jani Taskinen <jani.taskinen@sci.fi> wrote:Duh..I didn't realize it returned false ALWAYS.Johannes Schlüter wrote:[..]On Mon, 2008-12-08 at 12:36 +0000, "Jani Taskinen" wrote:Huh? Are you absolutely sure now? :) What would the use of defined() be if it didn't do what it's supposed to do? :D+// If __DIR__ is not defined, define it +if (!defined('__DIR__')) {defined() will always return true ...[jani@localhost ~]$ src/build/php_5_3/sapi/cli/php -d error_reporting=E_ALL -r 'var_dump(defined("__DIR__"));' bool(false)
defined() apparently doesn't work on magic constants (__LINE__, __METHOD__, __FILE__...). The docs don't mention this so I assume johannes found a bug he should report :)Well, magical or not, they're still constants. --Jani