From:             [EMAIL PROTECTED]
Operating system: Windows Vista
PHP version:      5.2.5
PHP Bug Type:     Scripting Engine problem
Bug description:  define('::') can be defined

Description:
------------
PHP (5.2.5) allows you to define '::' as a constant without issuing an
E_WARNING, below examples will demonstrate it.

The constant() function will issue an fatal error when recieving '::' as
constant name:
Fatal error: Class '' not found in C:\webserver\www\gd\gd.php on line 91

Which might also be wrong or confusing to the programmer

Reproduce code:
---------------
<?php
        define('::', true);
        var_dump(constant('::'));
?>

Expected result:
----------------
A fatal error for each of the calls:

Fatal error: Invalid constant name in test.php on line 2

Fatal error: Invalid constant name in test.php on line 3

Actual result:
--------------
Fatal error: Class '' not found in C:\webserver\www\gd\gd.php on line 91

None warning or fatal error for define()...

-- 
Edit bug report at http://bugs.php.net/?id=44827&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44827&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44827&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44827&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44827&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44827&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44827&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44827&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44827&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44827&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44827&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44827&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44827&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44827&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44827&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44827&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44827&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44827&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44827&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44827&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44827&r=mysqlcfg

Reply via email to