Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #75673: SplStack::unserialize() behavior
This commit is contained in:
Christoph M. Becker 2020-03-06 09:10:43 +01:00
commit b761997de3
3 changed files with 30 additions and 0 deletions

5
NEWS
View File

@ -1,6 +1,11 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.4.5
- Spl:
. Fixed bug #75673 (SplStack::unserialize() behavior). (cmb)
?? ??? ????, PHP 7.4.4
- Core:

View File

@ -1185,6 +1185,12 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
return;
}
while (intern->llist->count > 0) {
zval tmp;
spl_ptr_llist_pop(intern->llist, &tmp);
zval_ptr_dtor(&tmp);
}
s = p = (const unsigned char*)buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);

View File

@ -0,0 +1,19 @@
--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)