diff options
Diffstat (limited to 'tests/strings/offsets_general.phpt')
| -rw-r--r-- | tests/strings/offsets_general.phpt | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt index b2ceea088a..16960eac95 100644 --- a/tests/strings/offsets_general.phpt +++ b/tests/strings/offsets_general.phpt @@ -9,55 +9,19 @@ var_dump($string[0]); var_dump($string[1]); var_dump(isset($string[0])); var_dump(isset($string[0][0])); -var_dump($string["foo"]); +try { + var_dump($string["foo"]); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump(isset($string["foo"]["bar"])); -const FOO_DEPRECATED = "BAR"{0}; -var_dump(FOO_DEPRECATED); -var_dump([$string{0}]); // 1 notice -var_dump($string{1}); -var_dump(isset($string{0})); -var_dump(isset($string{0}{0})); // 2 notices -var_dump($string{"foo"}); -var_dump(isset($string{"foo"}{"bar"})); // 2 notices ?> ---EXPECTF-- - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d +--EXPECT-- string(1) "B" string(1) "f" string(1) "o" bool(true) bool(true) - -Warning: Illegal string offset 'foo' in %s line %d -string(1) "f" -bool(false) -string(1) "B" -array(1) { - [0]=> - string(1) "f" -} -string(1) "o" -bool(true) -bool(true) - -Warning: Illegal string offset 'foo' in %s line %d -string(1) "f" +Cannot access offset of type string on string bool(false) |
