|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-08-18 11:58 UTC] jani@php.net
[2009-08-19 08:04 UTC] dhaval4linux at yahoo dot com
[2009-08-19 08:10 UTC] dhaval4linux at yahoo dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 08 17:00:01 2025 UTC |
Description: ------------ Look at below code. on E_STRICT error_reporting either explode or array_pop is throwing warning about passed by reference. explode may returning something odd which causes array_pop to throw this warning. else explode may have problem which throws this warning. Below example shows both way with explode and without explode. with explode it shows warning while without that it works fine. Tested same thing on PHP version 5.2.10 and 5.2.6 Reproduce code: --------------- <?php error_reporting(E_ALL|E_STRICT); $stack2 = array("orange", "banana", "apple", "raspberry"); $stack = "orange_banana_apple_raspberry"; var_dump(strtolower(array_pop(explode('_',$stack)))); var_dump(strtolower(array_pop($stack2))); ?> Expected result: ---------------- string(9) "raspberry" string(9) "raspberry" Actual result: -------------- Strict Standards: Only variables should be passed by reference in /root/test.php on line 5 string(9) "raspberry" string(9) "raspberry"