HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //usr/share/pear/test/igbinary/tests/tests/igbinary_bug54662.phpt
--TEST--
Nested objects cause segfault, php bug #54662
--SKIPIF--
<?php if (!extension_loaded("igbinary")) print "skip"; ?>
--FILE--
<?php
/**
 * Proof of concept, segmentation fault (spl_array.c/igbinary.c)
 * when using nested objects.
 *
 * PHP 5.3.6, Igbinary 1.x
 *
 * @author Aleksey Korzun
 */

class Storage {
    public $storage = "a string";
}

$collection = new ArrayObject;
$collection->append(new Storage);

$ser = igbinary_serialize($collection);
$new_collection = igbinary_unserialize($ser);

var_dump($new_collection[0]->storage);
--EXPECT--
string(8) "a string"