mirror of
https://github.com/php/php-src.git
synced 2025-01-12 05:54:13 +08:00
21 lines
493 B
PHP
21 lines
493 B
PHP
--TEST--
|
|
Exceptions on improper access to string
|
|
--FILE--
|
|
<?php
|
|
$s = "ABC";
|
|
try {
|
|
$s[] = "D";
|
|
} catch (Error $e) {
|
|
echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
|
|
}
|
|
|
|
$s[] = "D";
|
|
?>
|
|
--EXPECTF--
|
|
Exception: [] operator not supported for strings in %sexception_015.php on line %d
|
|
|
|
Fatal error: Uncaught Error: [] operator not supported for strings in %sexception_015.php:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %sexception_015.php on line %d
|