|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-08-11 10:43 UTC] carlos dot ballesteros at softonic dot com
Description: ------------ Before PHP 5.3, get_defined_constants with a parameter returned the core constants in a key called "internal". In PHP5.3 in linux it's returning them as "Core" key. But in windows it's returned as key "mhash". It's pretty weird. It's similar to this bug: http://bugs.php.net/bug.php?id=47549 But at least in windows "mhash" key is wrong. And about linux, if the key changed from 'internal' to 'Core', I think it should, at least, be specified in the documentation. http://es2.php.net/get_defined_constants Reproduce code: --------------- print_r(get_defined_constants(true)); Expected result: ---------------- Array ( [internal] => Array ( [E_ERROR] => 1 [E_RECOVERABLE_ERROR] => 4096 ... Actual result: -------------- Linux: -bash-3.2# php -r"print_r(get_defined_constants(true));" | more Array ( [Core] => Array ( [E_ERROR] => 1 [E_RECOVERABLE_ERROR] => 4096 ... -bash-3.2# php -v PHP 5.3.0 (cli) (built: Jun 30 2009 21:37:54) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies Windows: C:\>php -r"print_r(get_defined_constants(true));" | more Array ( [mhash] => Array ( [E_ERROR] => 1 [E_RECOVERABLE_ERROR] => 4096 ... C:\>php -v PHP 5.3.0 (cli) (built: Jun 29 2009 21:55:01) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
It's not working even in the lastest snapshot. C:\dev\php53>php -v PHP 5.3.1-dev (cli) (built: Aug 11 2009 10:52:16) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies C:\dev\php53>php -r"print_r(get_defined_constants(true));" | more Array ( [mhash] => Array ( [E_ERROR] => 1 ...