Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php
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
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
Re: [PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php
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
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
[PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php
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 ... + define('__DIR__', realpath(dirname(__FILE__))); ... but this will never throw an error. $ sapi/cli/php -d error_reporting=E_ALL \ -r 'var_dump(__DIR__); var_dump(defined(__DIR__)); var_dump(define(__DIR__, 32));' string(39) /home/johannes/src/php/5.3/debug-notsrm bool(false) bool(true) Maybe it's better to check for the version there ... johannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: cvs: php-src(PHP_5_3) / run-tests.php
Hi Marcus, what's with HEAD? johannes On Wed, 2007-12-05 at 14:54 +, Marcus Boerger wrote: helly Wed Dec 5 14:54:08 2007 UTC Modified files: (Branch: PHP_5_3) /php-src run-tests.php Log: - - Allow to check the out,exp and diff results on console while executing the tests -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php