1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 09:12:14 +01:00
Files
archived-php-src/ext/standard/tests/array/extract_safety.phpt
Nikita Popov e2c8ab7c33 Print "interned" instead of fake refcount in debug_zval_dump()
debug_zval_dump() currently prints refcount 1 for interned strings
and arrays, which does not really reflect the truth. These values
are not refcounted, so the refcount is misleading. Instead print
an "interned" tag.

Closes GH-6598.
2021-01-15 12:21:24 +01:00

24 lines
358 B
PHP

--TEST--
Test extract() for overwrite of GLOBALS
--FILE--
<?php
$str = "John";
var_dump($GLOBALS["str"]);
/* Extracting Global Variables */
$splat = array("foo" => "bar");
var_dump(extract(array("GLOBALS" => $splat, EXTR_OVERWRITE)));
unset ($splat);
var_dump($GLOBALS["str"]);
echo "\nDone";
?>
--EXPECT--
string(4) "John"
int(1)
string(4) "John"
Done