php-src/ext/spl/tests/bug75673.phpt
Christoph M. Becker b84277297a Fix #75673: SplStack::unserialize() behavior
Even though `SplStack::unserialize()` is not supposed to be called on
an already constructed instance, it is probably better if the method
clears the stack before actually unserializing.
2020-03-06 09:09:49 +01:00

20 lines
357 B
PHP

--TEST--
Bug #75673 (SplStack::unserialize() behavior)
--FILE--
<?php
$stack = new SplStack();
$stack->push("one");
$stack->push("two");
$serialized = $stack->serialize();
var_dump($stack->count());
$stack->unserialize($serialized);
var_dump($stack->count());
$stack->unserialize($serialized);
var_dump($stack->count());
?>
--EXPECT--
int(2)
int(2)
int(2)