|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-10-18 10:16 UTC] pmmaga@php.net
-Package: Class/Object related
+Package: SPL_Types
[2018-10-18 12:25 UTC] cmb@php.net
[2021-05-31 13:57 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-05-31 13:57 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 07:00:02 2025 UTC |
Description: ------------ sorry for my bad English. i found bug in enum, just run code, and you`ll see, that on first var_dump variables has correct values object(CardType)#1 (1) { ["__default"]=> string(5) "table" } object(CardType)#2 (1) { ["__default"]=> string(4) "list" } but after assignment operation variable $card_type is broken. Sometimes it return another enum, but i can`t emulate this in short version of code, so just attach small code, which broke variable object(CardType)#1 (1) { ["__default"]=> UNKNOWN:0 } object(CardType)#2 (1) { ["__default"]=> string(5) "table" } think that happens because of some bugs in work with memory pointers on clone\copy operation Test script: --------------- class CardType extends SplEnum { const __default = 'list'; const CARD_LIST = 'list'; const TABLE = 'table'; const TABLE2 = 'table2'; } $card_type = new CardType('table'); $card_type2 = new CardType('list'); var_dump($card_type, $card_type2); $card_type2=$card_type; var_dump($card_type, $card_type2);