mirror of
https://github.com/php/php-src.git
synced 2026-04-13 19:14:16 +02:00
Merge branch 'PHP-7.3'
This commit is contained in:
22
ext/standard/tests/serialize/serialize_globals_var_refs.phpt
Normal file
22
ext/standard/tests/serialize/serialize_globals_var_refs.phpt
Normal file
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Reference IDs should be correctly generated when $GLOBALS is serialized
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj2 = new stdClass;
|
||||
$obj2->obj = $obj;
|
||||
$s = serialize($GLOBALS);
|
||||
$globals = unserialize($s);
|
||||
var_dump($obj);
|
||||
var_dump($obj2);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
object(stdClass)#2 (1) {
|
||||
["obj"]=>
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
}
|
||||
@@ -959,9 +959,9 @@ again:
|
||||
/* we should still add element even if it's not OK,
|
||||
* since we already wrote the length of the array before */
|
||||
if (Z_TYPE_P(data) == IS_ARRAY) {
|
||||
if (Z_TYPE_P(data) == IS_ARRAY
|
||||
&& (UNEXPECTED(Z_IS_RECURSIVE_P(data))
|
||||
|| UNEXPECTED(Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc)))) {
|
||||
if (UNEXPECTED(Z_IS_RECURSIVE_P(data))
|
||||
|| UNEXPECTED(Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc))) {
|
||||
php_add_var_hash(var_hash, struc);
|
||||
smart_str_appendl(buf, "N;", 2);
|
||||
} else {
|
||||
if (Z_REFCOUNTED_P(data)) {
|
||||
|
||||
Reference in New Issue
Block a user