mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
14bdb0cfc7
* Change a number of "resource used as offset" notices to warnings, which were previously missed. * Throw the "resource used as offset" warning for isset() as well. * Make array_key_exists() behavior with regard to different key types consistent with isset() and normal array accesses. All key types now use the usual coercions and array/object keys throw TypeError. Closes GH-4887.
16 lines
252 B
PHP
16 lines
252 B
PHP
--TEST--
|
|
Constexpr arrays should be able to handle resource keys
|
|
--FILE--
|
|
<?php
|
|
|
|
const FOO = [STDIN => 42];
|
|
var_dump(FOO);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
|
|
array(1) {
|
|
[%d]=>
|
|
int(42)
|
|
}
|