Bug #66167 [Opn->Dup]: Incorrect result on list()

From: Date: Mon, 25 Nov 2013 18:41:34 +0000
Subject: Bug #66167 [Opn->Dup]: Incorrect result on list()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182927@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66167&edit=1 ID: 66167 Updated by: nikic@php.net Reported by: sander at prezent dot nl Summary: Incorrect result on list() -Status: Open +Status: Duplicate Type: Bug Package: Unknown/Other Function Operating System: Debian PHP Version: 5.4.22 Block user comment: N Private report: N New Comment: Duplicate of https://bugs.php.net/bug.php?id=65969 Previous Comments: ------------------------------------------------------------------------ [2013-11-25 18:36:54] requinix@php.net My PHP 5.4.22 and 5.5.6 on Windows crashes, and 3v4l doesn't like it either. http://3v4l.org/3bspc Removing the assignment to $this->_foo makes it work again. ------------------------------------------------------------------------ [2013-11-25 14:34:00] sander at prezent dot nl 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 this bug report at https://bugs.php.net/bug.php?id=66167&edit=1

« previous php.bugs (#182927) next »