Edit report at https://bugs.php.net/bug.php?id=50816&edit=1

 ID:                 50816
 Patch added by:     larue...@php.net
 Reported by:        spasic dot dejan at yahoo dot de
 Summary:            Using class constants in array definition fails 
                     (works in PHP_5_2)
 Status:             Verified
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   *
 PHP Version:        5.3, 6
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

The following patch has been added/updated:

Patch Name: bug50816.patch
Revision:   1312039483
URL:        
https://bugs.php.net/patch-display.php?bug=50816&patch=bug50816.patch&revision=1312039483


Previous Comments:
------------------------------------------------------------------------
[2011-07-29 14:32:16] pierr...@php.net

This bug is due to the fact that the function
zend_hash_update_current_key_ex try to determinate if an element of
the array is before/after an other one with the new key by looking at
their position in the Bucket. The problem is that the key of the
element we want to change is not the same as the other one which mean
they're not always in the same Bucket (almost never).

The only solution I found was to determine which element is first by
looping into the array itself element per element. I tried to optimise
the patch by first making sure the second element exists so that I
don't loop on the array for nothing.

Any other idea is welcome

------------------------------------------------------------------------
[2011-07-29 14:30:24] pierr...@php.net

The following patch has been added/updated:

Patch Name: 50816-2.diff
Revision:   1311949824
URL:        
https://bugs.php.net/patch-display.php?bug=50816&patch=50816-2.diff&revision=1311949824

------------------------------------------------------------------------
[2011-07-29 04:14:28] pierr...@php.net

The following patch has been added/updated:

Patch Name: 50816-2.diff
Revision:   1311912867
URL:        
https://bugs.php.net/patch-display.php?bug=50816&patch=50816-2.diff&revision=1311912867

------------------------------------------------------------------------
[2011-07-29 00:54:11] pierr...@php.net

The following patch has been added/updated:

Patch Name: 50816.diff
Revision:   1311900851
URL:        
https://bugs.php.net/patch-display.php?bug=50816&patch=50816.diff&revision=1311900851

------------------------------------------------------------------------
[2010-01-22 13:45:10] j...@php.net

Works as expected in PHP 5.2, fails with 5.3 and above.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=50816


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=50816&edit=1

Reply via email to