php-src/tests/strings/offsets_chaining_5.phpt

28 lines
769 B
Plaintext
Raw Normal View History

2011-11-26 18:41:45 +00:00
--TEST--
testing the behavior of string offset chaining
--INI--
error_reporting=E_ALL | E_DEPRECATED
--FILE--
<?php
$array = array('expected_array' => "foobar");
var_dump(isset($array['expected_array']));
var_dump($array['expected_array']);
var_dump(isset($array['expected_array']['foo']));
var_dump($array['expected_array']['foo']);
var_dump(isset($array['expected_array']['foo']['bar']));
var_dump($array['expected_array']['foo']['bar']);
?>
--EXPECTF--
bool(true)
string(6) "foobar"
2011-12-19 16:57:36 +00:00
bool(false)
Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
2011-11-26 18:41:45 +00:00
string(1) "f"
2011-12-19 16:57:36 +00:00
bool(false)
Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
2011-11-26 18:41:45 +00:00
2011-12-19 16:57:36 +00:00
Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d
string(1) "f"