Re: cvs: php-src(PHP_5_3) / run-tests.php
| From: | Jani Taskinen | Date: | Tue, 09 Dec 2008 09:15:56 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_3) / run-tests.php | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-54778@lists.php.net to get a copy of this message | ||
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 ...
IF defined() doesn't do what it's supposed to..+ 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 ...Works fine for me (no errors): $ php -d error_reporting=E_ALL -r 'var_dump(defined("__DIR__"));' bool(false) [jani@localhost ~]$ php -v PHP 5.2.9-dev (cli) (built: Dec 8 2008 12:46:20) (DEBUG) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies [jani@localhost ~]$ src/build/php_5_3/sapi/cli/php -d error_reporting=E_ALL -r 'var_dump(defined("__DIR__"));' bool(false) --Jani