File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / strings / offsets_chaining_5.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:34:34 2012 UTC (12 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, HEAD
php 5.4.3+patches

--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"
bool(false)

Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
string(1) "f"
bool(false)

Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d

Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d
string(1) "f"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>