php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47549 get_defined_constants() return array with broken array categories
Submitted: 2009-03-03 07:49 UTC Modified: 2009-03-03 23:43 UTC
From: pahan at hubbitus dot info Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.0beta1 OS: Linux
Private report: No CVE-ID:
 [2009-03-03 07:49 UTC] pahan at hubbitus dot info
Description:
------------
When $categorize parameter set to true, and expected categorized result 
by extension it has crazy mishmash of keys and values.

Expected results got on version 5.2.9

Reproduce code:
---------------
<?
$constants = get_defined_constants(true);                                                                                                                      
print_r($constants['session']); //Key session used only for reduce results, all array affected
?>

Expected result:
----------------
Array
(
    [CONNECTION_ABORTED] => 1
    [CONNECTION_NORMAL] => 0
    [CONNECTION_TIMEOUT] => 2
<skiped...>
    [DNS_ANY] => 268435456
    [DNS_ALL] => 251713587
)






Actual result:
--------------
Array
(   
    [PREG_PATTERN_ORDER] => 1
    [PREG_SET_ORDER] => 2
    [PREG_OFFSET_CAPTURE] => 256
    [PREG_SPLIT_NO_EMPTY] => 1
    [PREG_SPLIT_DELIM_CAPTURE] => 2
    [PREG_SPLIT_OFFSET_CAPTURE] => 4
    [PREG_GREP_INVERT] => 1
    [PREG_NO_ERROR] => 0
    [PREG_INTERNAL_ERROR] => 1
    [PREG_BACKTRACK_LIMIT_ERROR] => 2
    [PREG_RECURSION_LIMIT_ERROR] => 3
    [PREG_BAD_UTF8_ERROR] => 4
    [PREG_BAD_UTF8_OFFSET_ERROR] => 5
    [PCRE_VERSION] => 7.3 2007-08-28
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-03 23:43 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 20:01:57 2014 UTC