mirror of
https://github.com/php/php-src.git
synced 2025-01-05 18:33:56 +08:00
b84277297a
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.
20 lines
357 B
PHP
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)
|