1--TEST--
2testing the behavior of string offsets
3--INI--
4error_reporting=E_ALL | E_DEPRECATED
5--FILE--
6<?php
7$string = "foobar";
8var_dump($string[0]);
9var_dump($string[1]);
10var_dump(isset($string[0]));
11var_dump(isset($string[0][0]));
12var_dump($string["foo"]);
13var_dump(isset($string["foo"]["bar"]));
14var_dump($string{0});
15var_dump($string{1});
16var_dump(isset($string{0}));
17var_dump(isset($string{0}{0}));
18var_dump($string{"foo"});
19var_dump(isset($string{"foo"}{"bar"}));
20?>
21--EXPECTF--
22string(1) "f"
23string(1) "o"
24bool(true)
25bool(true)
26
27Warning: Illegal string offset 'foo' in %s line %d
28string(1) "f"
29bool(false)
30string(1) "f"
31string(1) "o"
32bool(true)
33bool(true)
34
35Warning: Illegal string offset 'foo' in %s line %d
36string(1) "f"
37bool(false)
38
39