1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/standard/tests/array/bug24766.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

46 lines
511 B
PHP

--TEST--
Bug #24766 (strange result array from unpack)
--FILE--
<?php
error_reporting(E_ALL);
$a = unpack('C2', "\0224V");
$b = array(1 => 18, 2 => 52);
var_dump($a, $b);
$k = array_keys($a);
$l = array_keys($b);
var_dump($k, $l);
$i=$k[0];
var_dump($a[$i]);
$i=$l[0];
var_dump($b[$i]);
?>
--EXPECT--
array(2) {
[1]=>
int(18)
[2]=>
int(52)
}
array(2) {
[1]=>
int(18)
[2]=>
int(52)
}
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
int(18)
int(18)