tyrael Sat, 26 Nov 2011 18:41:45 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=319965
Log:
adding some tests for string offsets
Changed paths:
A php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt
A php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt
A php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt
A php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt
A php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt
A php/php-src/branches/PHP_5_3/tests/strings/offsets_general.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_1.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_2.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_3.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_4.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt
A php/php-src/branches/PHP_5_4/tests/strings/offsets_general.phpt
A php/php-src/trunk/tests/strings/offsets_chaining_1.phpt
A php/php-src/trunk/tests/strings/offsets_chaining_2.phpt
A php/php-src/trunk/tests/strings/offsets_chaining_3.phpt
A php/php-src/trunk/tests/strings/offsets_chaining_4.phpt
A php/php-src/trunk/tests/strings/offsets_chaining_5.phpt
A php/php-src/trunk/tests/strings/offsets_general.phpt
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0][0][0][0]);
+?>
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string{0}{0}[0][0]);
+?>
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string[0][0][0][0]));
+?>
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string{0}{0}[0][0]));
+?>
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,23 @@
+--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(true)
+string(1) "f"
+bool(false)
+
+Fatal error: Cannot use string offset as an array in %s on line %d
+
Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_general.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_general.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_general.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,33 @@
+--TEST--
+testing the behavior of string offsets
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0]);
+var_dump($string[1]);
+var_dump(isset($string[0]));
+var_dump(isset($string[0][0]));
+var_dump($string["foo"]);
+var_dump(isset($string["foo"]["bar"]));
+var_dump($string{0});
+var_dump($string{1});
+var_dump(isset($string{0}));
+var_dump(isset($string{0}{0}));
+var_dump($string{"foo"});
+var_dump(isset($string{"foo"}{"bar"}));
+?>
+--EXPECT--
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(false)
+string(1) "f"
+bool(false)
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(false)
+string(1) "f"
+bool(false)
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_1.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_1.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_1.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0][0][0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_2.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_2.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_2.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string{0}{0}[0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_3.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_3.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_3.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string[0][0][0][0]));
+?>
+--EXPECTF--
+bool(true)
+
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_4.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_4.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_4.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string{0}{0}[0][0]));
+?>
+--EXPECTF--
+bool(true)
+
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,22 @@
+--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(true)
+string(1) "f"
+bool(true)
+string(1) "f"
+
Added: php/php-src/branches/PHP_5_4/tests/strings/offsets_general.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/tests/strings/offsets_general.phpt (rev 0)
+++ php/php-src/branches/PHP_5_4/tests/strings/offsets_general.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,34 @@
+--TEST--
+testing the behavior of string offsets
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0]);
+var_dump($string[1]);
+var_dump(isset($string[0]));
+var_dump(isset($string[0][0]));
+var_dump($string["foo"]);
+var_dump(isset($string["foo"]["bar"]));
+var_dump($string{0});
+var_dump($string{1});
+var_dump(isset($string{0}));
+var_dump(isset($string{0}{0}));
+var_dump($string{"foo"});
+var_dump(isset($string{"foo"}{"bar"}));
+?>
+--EXPECT--
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+string(1) "f"
+bool(true)
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+string(1) "f"
+bool(true)
+
Added: php/php-src/trunk/tests/strings/offsets_chaining_1.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_chaining_1.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_chaining_1.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0][0][0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
Added: php/php-src/trunk/tests/strings/offsets_chaining_2.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_chaining_2.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_chaining_2.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string{0}{0}[0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
Added: php/php-src/trunk/tests/strings/offsets_chaining_3.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_chaining_3.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_chaining_3.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string[0][0][0][0]));
+?>
+--EXPECTF--
+bool(true)
+
Added: php/php-src/trunk/tests/strings/offsets_chaining_4.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_chaining_4.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_chaining_4.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string{0}{0}[0][0]));
+?>
+--EXPECTF--
+bool(true)
+
Added: php/php-src/trunk/tests/strings/offsets_chaining_5.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_chaining_5.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_chaining_5.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,22 @@
+--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(true)
+string(1) "f"
+bool(true)
+string(1) "f"
+
Added: php/php-src/trunk/tests/strings/offsets_general.phpt
===================================================================
--- php/php-src/trunk/tests/strings/offsets_general.phpt (rev 0)
+++ php/php-src/trunk/tests/strings/offsets_general.phpt 2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,34 @@
+--TEST--
+testing the behavior of string offsets
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0]);
+var_dump($string[1]);
+var_dump(isset($string[0]));
+var_dump(isset($string[0][0]));
+var_dump($string["foo"]);
+var_dump(isset($string["foo"]["bar"]));
+var_dump($string{0});
+var_dump($string{1});
+var_dump(isset($string{0}));
+var_dump(isset($string{0}{0}));
+var_dump($string{"foo"});
+var_dump(isset($string{"foo"}{"bar"}));
+?>
+--EXPECT--
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+string(1) "f"
+bool(true)
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+string(1) "f"
+bool(true)
+
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php