Bug #66167 [NEW]: Incorrect result on list()
| From: | sander at prezent dot nl | Date: | Mon, 25 Nov 2013 14:34:00 +0000 |
| Subject: | Bug #66167 [NEW]: Incorrect result on list() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182922@lists.php.net to get a copy of this message | ||
From: sander at prezent dot nl
Operating system: Debian
PHP version: 5.4.22
Package: Unknown/Other Function
Bug Type: Bug
Bug description:Incorrect result on list()
Description:
------------
The attached test script seems not to work in PHP 5.4 and PHP 5.5:
On PHP 5.3 the output is (as I expect):
array(2) {
[0]=>
string(3) "foo"
[1]=>
string(3) "bar"
}
string(3) "foo"
string(3) "bar"
On PHP 5.4 the output is (which is IMHO incorrect):
array(2) {
[0] =>
string(3) "foo"
[1] =>
string(3) "bar"
}
NULL
NULL
On PHP 5.5 the test code causes a SEGFAULT.
Exact PHP versions used:
On Debian Squeeze:
PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011
13:13:26)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by
ionCube Ltd., and
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins
GmbH
On Debian Wheezy:
PHP 5.4.21-1~dotdeb.1 (cli) (built: Nov 3 2013 06:56:41)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
PHP 5.5.3-1~dotdeb.1 (cli) (built: Aug 29 2013 05:44:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend
Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Test script:
---------------
<?php
class Test
{
var $_foo = null;
function Test()
{
}
function run()
{
list($foo, $bar) = $this->_foo = $this->get();
var_dump($this->_foo);
var_dump($foo);
var_dump($bar);
}
function get()
{
return array('foo', 'bar');
}
}
$test = new Test();
$test->run();
--
Edit bug report at https://bugs.php.net/bug.php?id=66167&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66167&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66167&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66167&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66167&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66167&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66167&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66167&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66167&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66167&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66167&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66167&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66167&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66167&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66167&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66167&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66167&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66167&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66167&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66167&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66167&r=mysqlcfg