Johannes Schlüter wrote:
On Mon, 2008-12-08 at 12:36 +0000, "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

+       define('__DIR__', realpath(dirname(__FILE__)));

.. but this will never throw an error.

IF defined() doesn't do what it's supposed to..

$ 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"

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__"));'
[EMAIL PROTECTED] ~]$ 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
[EMAIL PROTECTED] ~]$ src/build/php_5_3/sapi/cli/php -d error_reporting=E_ALL -r 'var_dump(defined("__DIR__"));'


PHP CVS Mailing List (
To unsubscribe, visit:

Reply via email to