1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 20:41:18 +02:00
Files
archived-php-src/ext/standard/tests/serialize/bug73154.phpt
Nikita Popov be4ce98bdc Fixed bug #73154
The object that is being serialized may be destroyed during the
execution of __sleep(), so operate on a copy instead.
2017-01-01 21:11:01 +01:00

17 lines
324 B
PHP

--TEST--
Bug #73154: serialize object with __sleep function crash
--FILE--
<?php
class a {
public $a;
public function __sleep() {
$this->a=null;
return array();
}
}
$s = 'a:1:{i:0;O:1:"a":1:{s:1:"a";R:2;}}';
var_dump(serialize(unserialize($s)));
?>
--EXPECT--
string(22) "a:1:{i:0;O:1:"a":0:{}}"