mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
28 lines
611 B
PHP
28 lines
611 B
PHP
--TEST--
|
|
Deprecate using null as array offset
|
|
--FILE--
|
|
<?php
|
|
$arr = ['foo' => 'bar', '' => 'baz'];
|
|
|
|
echo $arr[null] . "\n";
|
|
|
|
$arr[null] = 'new_value';
|
|
echo $arr[''] . "\n";
|
|
|
|
var_dump(isset($arr[null]));
|
|
|
|
unset($arr[null]);
|
|
var_dump(isset($arr['']));
|
|
?>
|
|
--EXPECTF--
|
|
|
|
Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
|
|
baz
|
|
|
|
Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
|
|
new_value
|
|
|
|
Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
|
|
bool(true)
|
|
bool(false)
|