|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-12-31 02:40 UTC] tokimeki at 1111 dot com dot tw
Description: ------------ look the two source, index.php and debug.php. At index.php (line 29), after array copy, and call show_var to show $arr or $test, I get a error. Reproduce code: --------------- http://timteam.org/?TIM=FORUM&FORUM=1&ShowDocument=12961#TIM12961 Expected result: ---------------- ok (array) = { obj (object) = {} str (string) = str arr (array) = {} number (integer) = 100 bool (boolean) = 1 null (NULL) = test (array) = { AAA (string) = 000 BBB (array) = { zzz (string) = Z xxx (array) = { zzz (string) = Z xxx (array) -> (@[test][BBB][xxx]) } yyy (array) = { www (array) -> (@[test][BBB]) vvv (array) -> (@[test][BBB]) } } CCC (array) -> (@) DDD (string) = ABC EEE (array) -> (@[test][BBB][yyy]) FFF (array) -> (@[test][BBB]) <>[]!@#$%^&*()_+|~`\:;,.? (array) = { TEST (string) = <>[]!@#$%^&*()_+|~`\:;,.? } (array) -> (@[test][<>[]!@#$%^&*()_+|~`\:;,.?]) } } Actual result: -------------- ok Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 128 bytes) in /home/tokimeki/public_html/test/debug.php on line 29 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 10:00:01 2025 UTC |
I find a solution. use this function to replace array copy. ex: $test = clone($arr); // replace $test = $arr; function & clone(&$var) { return $var; }