summaryrefslogtreecommitdiff
path: root/Zend/tests/exception_015.phpt
blob: a2b27154f65734d865b63d98ef6627e3ca203706 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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