Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php

2008-12-09 Thread Jani Taskinen

Johannes Schlüter wrote:

On Tue, 2008-12-09 at 10:56 +0100, Hannes Magnusson wrote:

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 :)


If there is a bug it's in the docs I'd say as get_defined_constants(),
constant() and probably others don't know them either and I don't think
it's good to add special handling to a these functions. I didn't know
that's not in the docs so I didn't report but can do :-)


I fixed run-tests.php to use version id instead like you suggested 
earlier. :)


--Jani


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php

2008-12-09 Thread Johannes Schlüter
On Tue, 2008-12-09 at 10:56 +0100, Hannes Magnusson wrote:
> 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 
> :)

If there is a bug it's in the docs I'd say as get_defined_constants(),
constant() and probably others don't know them either and I don't think
it's good to add special handling to a these functions. I didn't know
that's not in the docs so I didn't report but can do :-)

johannes


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php

2008-12-09 Thread Jani Taskinen

Hannes Magnusson wrote:

On Tue, Dec 9, 2008 at 10:15, Jani Taskinen <[EMAIL PROTECTED]> wrote:

Johannes Schlüter wrote:

On Mon, 2008-12-08 at 12:36 +, "Jani Taskinen" wrote:

+// If __DIR__ is not defined, define it
+if (!defined('__DIR__')) {

defined() will always return true ...

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

[..]


[EMAIL PROTECTED] ~]$ src/build/php_5_3/sapi/cli/php -d error_reporting=E_ALL
-r 'var_dump(defined("__DIR__"));'
bool(false)




Duh..I didn't realize it returned false ALWAYS.


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


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php

2008-12-09 Thread Hannes Magnusson
On Tue, Dec 9, 2008 at 10:15, Jani Taskinen <[EMAIL PROTECTED]> wrote:
> Johannes Schlüter wrote:
>>
>> On Mon, 2008-12-08 at 12:36 +, "Jani Taskinen" wrote:
>>>
>>> +// If __DIR__ is not defined, define it
>>> +if (!defined('__DIR__')) {
>>
>> defined() will always return true ...
>
> 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
[..]

> [EMAIL PROTECTED] ~]$ 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 :)

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php