mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
f0fd5922ee
Closes GH-7167
22 lines
418 B
PHP
22 lines
418 B
PHP
--TEST--
|
|
Bug #81159: Object to int warning when using an object as a string offset
|
|
--FILE--
|
|
<?php
|
|
|
|
$s = 'Hello';
|
|
$o = new stdClass();
|
|
try {
|
|
$s[$o] = 'A';
|
|
} catch (\Throwable $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($s[$o]);
|
|
} catch (\Throwable $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Cannot access offset of type stdClass on string
|
|
Cannot access offset of type stdClass on string
|