mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #75673: SplStack::unserialize() behavior
This commit is contained in:
commit
b761997de3
5
NEWS
5
NEWS
@ -1,6 +1,11 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
?? ??? ????, PHP 7.4.5
|
||||
|
||||
- Spl:
|
||||
. Fixed bug #75673 (SplStack::unserialize() behavior). (cmb)
|
||||
|
||||
?? ??? ????, PHP 7.4.4
|
||||
|
||||
- Core:
|
||||
|
@ -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);
|
||||
|
||||
|
19
ext/spl/tests/bug75673.phpt
Normal file
19
ext/spl/tests/bug75673.phpt
Normal 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)
|
Loading…
Reference in New Issue
Block a user