php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66181 Assign a variable to a property then list
Submitted: 2013-11-26 19:01 UTC Modified: 2013-11-26 19:09 UTC
From: phil at philsturgeon dot co dot uk Assigned:
Status: Duplicate Package: Reproducible crash
PHP Version: 5.4.22 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
46 - 37 = ?
Subscribe to this entry?

 
 [2013-11-26 19:01 UTC] phil at philsturgeon dot co dot uk
Description:
------------
PHP 5.5.6-1+debphp.org~quantal+2

When assigning a variable to a property and then using list() on the result of that I get a segfault with code 139 being the response. 

I ran this through 3v4l and it happens on everything over PHP 5.4.0.



Test script:
---------------
<?php

class Foo {
    protected $box;

    public function setBox(array $box)
    {
        // Breaks FPM and gives a 502 due to connection reset by peers
        list($lat1, $lon1, $lat2, $lon2) = $this->box = $box;

        return $this;
    }
}

$foo = new Foo;
$foo->setBox(explode(',', '40.688235,-74.013718,40.756427,-73.958770'));

echo "Success";

Expected result:
----------------
"Success"

Actual result:
--------------
Process exited with code 139.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-26 19:03 UTC] phil at philsturgeon dot co dot uk
Here is the failing script running on 3v4l:

http://3v4l.org/q9clC

It is worth noting that when I split the assignment onto two lines and assign $box to $this->box first it works fine:

http://3v4l.org/fHan2
 [2013-11-26 19:09 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2013-11-26 19:09 UTC] requinix@php.net
See bug #65969 Chain assignment failure
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC