#49284 [Bgs]: explode or array_pop throws worning on error_reporting(E_ALL|E_STRICT)
| From: | dhaval4linux at yahoo dot com | Date: | Wed, 19 Aug 2009 08:10:29 +0000 |
| Subject: | #49284 [Bgs]: explode or array_pop throws worning on error_reporting(E_ALL|E_STRICT) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-141227@lists.php.net to get a copy of this message | ||
ID: 49284
User updated by: dhaval4linux at yahoo dot com
Reported By: dhaval4linux at yahoo dot com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.2.10
New Comment:
Got it from Bug http://bugs.php.net/bug.php?id=48937
Thanks
Previous Comments:
------------------------------------------------------------------------
[2009-08-19 08:04:37] dhaval4linux at yahoo dot com
Can I ask Why it is Bogus?
although its showing warning.
------------------------------------------------------------------------
[2009-08-18 11:58:51] jani@php.net
Thank you for not searching before submitting another duplicate bogus
report. This is not a bug.
------------------------------------------------------------------------
[2009-08-18 08:08:07] dhaval4linux at yahoo dot com
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"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49284&edit=1