Last active
October 6, 2016 18:02
-
-
Save mente/e8e4bd6bf3ba11d2a75ff5a5a4ae73e1 to your computer and use it in GitHub Desktop.
igbinary segfault reproduce on php7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = []; | |
for ($i = 0; $i < 40; $i++) { | |
$inner = new stdClass; | |
$inner->a = $i % 25; | |
$result[0][$inner->a][$i] = $inner; | |
$result[1][] = $inner; | |
} | |
igbinary_unserialize(igbinary_serialize($result)); |
If replace
$result[1][] = $inner;
with
$result[1][] = clone $inner;
it does not segfault either
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With 10 items it doesn't segfault