[2008年03月19日 20:58 UTC] computerlov at yahoo dot com
Description: ------------ when doing something like this: $arrOfObjects = array($obj1, obj2....obj10); $oSomeObject = new CSomeClass(); array_splice($arrOfObjects, 8, 2, $oSomeObject); instead of getting an array of 9 objects, you get an array of 8 objects and all the data members of CSomeClass in the array. it's as if we kind of 'var_dumped' the object into the array instead of copying it to the array. Reproduce code: --------------- class CSomeClass { private $m_var1; private $m_var2; } ... $oSomeClass = new CSomeClass(); .. Do Stuff on $oSomeClass .. $arrObjects = ($obj1, $obj2); array_splice($arrObjects, 1, 1, $oSomeClass); Expected result: ---------------- $arrObjects = {$obj1, $obj2, $oSomeClass} Actual result: -------------- $arrObjects = {$obj1, $obj2, $m_var1, $m_var2} PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008年03月19日 21:34 UTC] felipe@php.net
[2008年03月19日 22:54 UTC] computerlov at yahoo dot com
[2008年03月19日 23:01 UTC] computerlov at yahoo dot com
[2008年03月20日 10:58 UTC] felipe@php.net
[2008年03月20日 11:02 UTC] felipe@php.net
[2008年03月20日 13:44 UTC] computerlov at yahoo dot com
[2008年03月20日 14:02 UTC] felipe@php.net
[2008年03月20日 16:35 UTC] computerlov at yahoo dot com
[2008年03月20日 21:19 UTC] ezyang@php.net
[2020年02月07日 06:10 UTC] phpdocbot@php.net
|