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"
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)
[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__"));'
bool(false)

--Jani



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

Reply via email to