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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phil at philsturgeon dot co dot uk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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 Nov 21 16:01:29 2024 UTC