]> granicus.if.org Git - php/commitdiff
fix tests, add UEXPECTF
authorAntony Dovgal <tony2001@php.net>
Mon, 14 May 2007 13:05:29 +0000 (13:05 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 14 May 2007 13:05:29 +0000 (13:05 +0000)
13 files changed:
ext/standard/tests/array/array_merge.phpt
ext/standard/tests/array/array_values.phpt
ext/standard/tests/array/end.phpt
ext/standard/tests/general_functions/debug_zval_dump_b.phpt
ext/standard/tests/general_functions/print_r.phpt
ext/standard/tests/general_functions/strval.phpt
ext/standard/tests/general_functions/var_dump.phpt
ext/standard/tests/strings/addcslashes.phpt
ext/standard/tests/strings/implode1.phpt
ext/standard/tests/strings/str_repeat.phpt
ext/standard/tests/strings/str_replace.phpt
ext/standard/tests/strings/strpos.phpt
ext/standard/tests/strings/ucfirst1.phpt

index 614907141759e4e2703efe25a2775013f153e0ca..72142373f6be2f832988ad07f5ea73d0b660e27e 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Test array_merge() function
+--INI--
+precision=14
 --FILE--
 <?php
 /* Prototype: array array_merge(array $array1 [, array $array2 [, array $...]]);
index 2772120e56fe33f134fc8f9bac2112b9994ae980..f3399c1fc1fa0f4e8fe7bf8db21ab7d4f8614d50 100644 (file)
Binary files a/ext/standard/tests/array/array_values.phpt and b/ext/standard/tests/array/array_values.phpt differ
index df0465c9d4e84659cf60989bb7dd333be3535130..f87593e122de8c0a0999cea98ae28acef21703f4 100644 (file)
 --TEST--
-Test print_r() function
+Test end() function
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--INI--
+precision=14
 --FILE--
-
 <?php
-/* Prototype: bool print_r ( mixed $expression [, bool $return] );
-   Description: Prints human-readable information about a variable
+/* Prototype: mixed end ( array &$array );
+   Description: Advances internal pointer of array to last element, and returns its value.
 */
 
-/* Prototype: void check_printr( $variables )
-   Description: use print_r() to print variables */
-function check_printr( $variables ) {
-  $counter = 1;
-  foreach( $variables as $variable ) {
-    echo "\n-- Iteration $counter --\n";
-    //default = false, prints output to screen
-    print_r($variable);
-    //$return=TRUE, print_r() will return its output, instead of printing it
-    $ret_string = print_r($variable, true); //$ret_string captures the output
-    echo "\n$ret_string\n";
-    //$return=false, print_r() prints the output; default behavior
-    print_r($variable, false);
-    $counter++;
-  }
-}
-  
-echo "\n*** Testing print_r() on integer variables ***\n";
-$integers = array ( 
-  0,  // zero as argument
-  000000123,  //octal value of 83
-  123000000,
-  -00000123,  //octal value of 83
-  -12300000,
-  range(1,10),  // positive values
-  range(-1,-10),  // negative values
-  +2147483647,  // max positive integer
-  +2147483648,  // max positive integer + 1
-  -2147483648,  // min range of integer
-  -2147483647,  // min range of integer + 1
-  0x7FFFFFFF,  // max positive hexadecimal integer
-  -0x80000000,  // min range of hexadecimal integer
-  017777777777,  // max posotive octal integer
-  -020000000000  // min range of octal integer
-);                 
-/* calling check_printr() to display contents of integer variables
-   using print_r() */
-check_printr($integers);
-
-echo "\n*** Testing print_r() on float variables ***\n";
-$floats = array (
-  -0.0,
-  +0.0,
-  1.234,
-  -1.234,
-  -2.000000,
-  000002.00,
-  -.5,
-  .567,
-  -.6700000e-3,
-  -.6700000E+3,
-  .6700000E+3,
-  .6700000e+3,
-  -4.10003e-3,
-  -4.10003E+3,
-  4.100003e-3,
-  4.100003E+3,
-  1e5,
-  -1e5,
-  1e-5,
-  -1e-5,
-  1e+5,
-  -1e+5,
-  1E5,
-  -1E5,
-  1E+5,
-  -1E+5,
-  1E-5,
-  -1E-5,
-  -0x80000001,  // float value, beyond max negative int
-  0x80000001,  // float value, beyond max positive int
-  020000000001,  // float value, beyond max positive int
-  -020000000001  // float value, beyond max negative int 
-);
-/* calling check_printr() to display contents of float variables
-   using print_r() */
-check_printr($floats);
-
-echo "\n*** Testing print_r() on string variables ***\n";
-$strings = array (
-  "",
-  '',
-  " ",
-  ' ',
-  "0",
-  "\0",
-  '\0',
-  "\t",
-  '\t',
-  "PHP",
-  'PHP',
-  "abcd\x0n1234\x0005678\x0000efgh\xijkl",  // strings with hexadecimal NULL
-  "abcd\0efgh\0ijkl\x00mnop\x000qrst\00uvwx\0000yz",  // strings with octal NULL
-  "1234\t\n5678\n\t9100\rabcda"  // strings with escape characters
-);
-/* calling check_printr() to display contents of strings using print_r() */
-check_printr($strings);
-
-echo "\n*** Testing print_r() on boolean variables ***\n";
-$booleans = array (
-  TRUE,
-  FALSE,
-  true,
-  false
-);       
-/* calling check_printr() to display boolean variables using print_r() */
-check_printr($booleans);
-var_dump( reset($booleans) );
-echo "\n";
-var_dump( current($booleans) );
-
-echo "\n*** Testing print_r() on array variables ***\n";
 $arrays = array (
-  array(),
-  array(NULL),
-  array(null),
-  array(true),
-  array(""),
-  array(''),
-  array(array(), array()),
-  array(array(1, 2), array('a', 'b')),
-  array(1 => 'One'),
-  array("test" => "is_array"),
-  array(0),
-  array(-1),
-  array(10.5, 5.6),
-  array("string", "test"),
-  array('string', 'test'),
-  $array1 = array(1,2,3,4, &$array1)  // recursive array
+  array( 0 ),
+  range(1, 100 ),
+  range('a', 'z', 2 ),
+  array("a" => "A", 2 => "B", "C" => 3, 4 => 4, "one" => 1, "" => NULL ),
+  array(1, array(1, 2 => 3 ), "one" => 1, "5" => 5 ),
+  array(-1, -2, -3, -4, "-0.005" => "neg0.005", 2.0 => "float2", "neg.9" => -.9 ),
+  array(1.0005, 2.000000, -3.000000, -4.9999999 ),
+  array(true, false),
+  array("PHP", "Web2.0", "SOA"),
+  array(1, array() ),
+  array(1, 2, "" ),
+  array(" "),
+  array(2147483647, 2147483648, -2147483647, -2147483648 ),
+  array(0x7FFFFFFF, -0x80000000, 017777777777, -020000000000 ),
+  array(-.6700000E+3, -4.10003E+3, 1e-5, -1E+5, 000002.00 )
 );
-/* calling check_printr() to display contents of $arrays */
-check_printr($arrays);
+/* loop through $arrays to print the last element of each sub-array */ 
+echo "*** Testing end() on different arrays ***\n";
+$counter = 1;
+foreach ($arrays as $sub_array){
+  echo "-- Iteration $counter --\n";
+  var_dump( end($sub_array) );
+  /* ensure that internal pointer is moved to last element */
+  var_dump( current($sub_array) ); 
+  $counter++;
+}
 
-echo "\n*** Testing print_r() on object variables ***\n";
-class object_class
+/* checking for end() on sub-arrays */
+echo "\n*** Testing end() with sub-arrays ***\n";
+$test_array = array(1, array(1 => "one", "two" => 2, "" => "f") );
+var_dump( end($test_array) );
+var_dump( end($test_array[1]) );
+
+/* checking working of end() when array elements are deleted */
+echo "\n*** Testing end() when array elements are deleted ***\n";
+$array_test = array("a", "b", "d", 7, "u" => "U", -4, "-.008" => "neg.008");
+
+// remove first element from array 
+echo "\n-- Remove first element from array --\n";
+unset($array_test[0]);
+var_dump( end($array_test) );
+
+// remove last element from array, rewind and check end() 
+echo "\n-- Remove last element from array --\n";
+unset($array_test['-.008']);
+var_dump( end($array_test) );
+reset( $array_test );
+var_dump( end($array_test) );
+
+// remove any element  !first, !last, rewind and check end() 
+echo "\n-- Remove any element from array apart from first and last element --\n";
+unset($array_test[7]);
+var_dump( end($array_test) );
+var_dump( reset($array_test) );
+var_dump( end($array_test) );
+
+/* Checking on OBJECTS type */
+echo "\n*** Testing end() on objects ***\n";
+class foo
 {
-  var       $value;
-  public    $public_var1 = 10;
-  private   $private_var1 = 20;
-  private   $private_var2;
-  protected $protected_var1 = "string_1";
-  protected $protected_var2;
-
-  function object_class ( ) {
-    $this->value = 50;
-    $this->public_var2 = 11;
-    $this->private_var2 = 21;
-    $this->protected_var2 = "string_2";
-  }
-
-  public function foo1() {
-    echo "foo1() is called\n";
-  }
-  protected function foo2() {
-    echo "foo2() is called\n";
-  }
-  private function foo3() {
-    echo "foo3() is called\n";
+  function __toString() {
+    return "Object";
   }
 }
-/* class with no member */
-class no_member_class {
- // no members
-}
-
-/* class with member as object of other class */
-class contains_object_class
+class foo1
 {
-   var       $p = 30;
-   var       $class_object1;
-   public    $class_object2;
-   private   $class_object3;
-   protected $class_object4;
-   var       $no_member_class_object;
-
-   public function func() {
-     echo "func() is called \n";
-   }
-
-   function contains_object_class () {
-     $this->class_object1 = new object_class();
-     $this->class_object2 = new object_class();
-     $this->class_object3 = $this->class_object1;
-     $this->class_object4 = $this->class_object2;
-     $this->no_member_class_object = new no_member_class();
-     $this->class_object5 = $this;   //recursive reference
-   }
+  function __toString() {
+    return "Object1";
+  }
 }
 
-/* objects of different classes */
-$obj = new contains_object_class;
-$temp_class_obj = new object_class();
+$object1 = new foo(); //new object created
+$object2 = new foo1();
 
-/* object which is unset */
-$unset_obj = new object_class();
-unset($unset_obj);
-
-$objects = array (
-  new object_class,
-  new no_member_class,
-  new contains_object_class,
-  $obj,
-  $obj->class_object1,
-  $obj->class_object2,
-  $obj->no_member_class_object,
-  $temp_class_obj,
-  @$unset_obj
-);
-/* calling check_printr() to display contents of the objects using print_r() */
-check_printr($objects);
+$array_object = array();
+$array_object[0] = &$object1;
+$array_object[1] = &$object2;
+var_dump( end($array_object) );
+var_dump($array_object);
 
-echo "\n** Testing print_r() on objects having circular reference **\n";
-$recursion_obj1 = new object_class();
-$recursion_obj2 = new object_class();
-$recursion_obj1->obj = &$recursion_obj2;  //circular reference
-$recursion_obj2->obj = &$recursion_obj1;  //circular reference
-print_r($recursion_obj2);
+/* Checking on RESOURCE type */
+echo "\n*** Testing end() on resource type ***\n";
+//file type resource
+$file_handle = fopen(__FILE__, "r");
 
-echo "\n*** Testing print_r() on resources ***\n";
-/* file type resource */
-$file_handle = fopen(__FILE__, "r"); 
-
-/* directory type resource */
+//directory type resource
 $dir_handle = opendir( dirname(__FILE__) );
 
-$resources = array (
-  $file_handle,
-  $dir_handle
-);
-/* calling check_printr() to display the resource content type
-   using print_r() */
-check_printr($resources);
-
-echo "\n*** Testing print_r() on different combinations of scalar 
-            and non-scalar variables ***\n";
-/* a variable which is unset */
-$unset_var = 10.5;
-unset($unset_var);
-
-/* unset file type resource */
-unset($file_handle);
+//store resources in array
+$resources = array($file_handle, $dir_handle);
+var_dump( end($resources) );
+var_dump( current($resources) );
 
-$variations = array (
-  array( 123, -1.2345, "a" ),
-  array( "d", array(1, 3, 5), true, null),
-  array( new no_member_class, array(), false, 0 ),
-  array( -0.00, "Where am I?", array(7,8,9), TRUE, 'A', 987654321 ),
-  array( @$unset_var, 2.E+10, 100-20.9, 000004.599998 ),  //unusual data
-  array( "array(1,2,3,4)1.0000002TRUE", @$file_handle, 111333.00+45e5, '/00\7') 
-);
-/* calling check_printr() to display combinations of scalar and 
-   non-scalar variables using print_r() */
-check_printr($variations);
-
-echo "\n*** Testing print_r() on miscelleneous input arguments ***\n";
-$misc_values = array (
-  @$unset_var,
-  NULL,  // NULL argument
-  @$undef_variable,  //undefined variable
-  null
-);
-/* calling check_printr() to display miscelleneous data using print_r() */
-check_printr($misc_values);
-
-/* checking print_r() on functions */
-echo "\n*** Testing print_r() on anonymous functions ***\n";
-$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);');
-echo "New anonymous function: $newfunc\n";
-print_r( $newfunc(2, 3) );
-/* creating anonymous function dynamically */
-print_r( create_function('$a', 'return "$a * $a = " . ($a * $b);') );
-
-echo "\n\n*** Testing error conditions ***\n";
-//passing zero argument
-var_dump( print_r() );
+echo "\n*** Testing error conditions ***\n";
+/* checking for unexpected number of arguments */
+var_dump( end() );
+var_dump( end($array[0], $array[0]) );
 
-//passing more than required no. of arguments
-var_dump( print_r(123, true, "abc") );
+/* checking for unexpected type of arguments */
+$var=1;
+$var1="string";
+var_dump( end($var) );
+var_dump( end($var1) );
 
-// check when second arg is given other than boolean TRUE
-var_dump( print_r ($value, "string") );
-
-/* closing resource handle used */
-closedir($dir_handle);
+/* checking null array */
+$null_array = array();
+var_dump( end($null_array) );
 
 echo "Done\n";
-?>
---EXPECTF--
-*** Testing print_r() on integer variables ***
 
--- Iteration 1 --
-0
-0
-0
--- Iteration 2 --
-83
-83
-83
--- Iteration 3 --
-123000000
-123000000
-123000000
--- Iteration 4 --
--83
--83
--83
--- Iteration 5 --
--12300000
--12300000
--12300000
--- Iteration 6 --
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => 5
-    [5] => 6
-    [6] => 7
-    [7] => 8
-    [8] => 9
-    [9] => 10
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => 5
-    [5] => 6
-    [6] => 7
-    [7] => 8
-    [8] => 9
-    [9] => 10
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => 5
-    [5] => 6
-    [6] => 7
-    [7] => 8
-    [8] => 9
-    [9] => 10
-)
-
--- Iteration 7 --
-Array
-(
-    [0] => -1
-    [1] => -2
-    [2] => -3
-    [3] => -4
-    [4] => -5
-    [5] => -6
-    [6] => -7
-    [7] => -8
-    [8] => -9
-    [9] => -10
-)
-
-Array
-(
-    [0] => -1
-    [1] => -2
-    [2] => -3
-    [3] => -4
-    [4] => -5
-    [5] => -6
-    [6] => -7
-    [7] => -8
-    [8] => -9
-    [9] => -10
-)
-
-Array
-(
-    [0] => -1
-    [1] => -2
-    [2] => -3
-    [3] => -4
-    [4] => -5
-    [5] => -6
-    [6] => -7
-    [7] => -8
-    [8] => -9
-    [9] => -10
-)
+?>
 
--- Iteration 8 --
-2147483647
-2147483647
-2147483647
--- Iteration 9 --
-2147483648
-2147483648
-2147483648
--- Iteration 10 --
--2147483648
--2147483648
--2147483648
--- Iteration 11 --
--2147483647
--2147483647
--2147483647
--- Iteration 12 --
-2147483647
-2147483647
-2147483647
--- Iteration 13 --
--2147483648
--2147483648
--2147483648
--- Iteration 14 --
-2147483647
-2147483647
-2147483647
--- Iteration 15 --
--2147483648
--2147483648
--2147483648
-*** Testing print_r() on float variables ***
+--CLEAN--
+/* cleaning resource handles */
+fclose( $file_handle );  //file resource handle deleted
+closedir( $dir_handle );  //dir resource handle deleted
 
+--EXPECTF--
+*** Testing end() on different arrays ***
 -- Iteration 1 --
-0
-0
-0
+int(0)
+int(0)
 -- Iteration 2 --
-0
-0
-0
+int(100)
+int(100)
 -- Iteration 3 --
-1.234
-1.234
-1.234
+string(1) "y"
+string(1) "y"
 -- Iteration 4 --
--1.234
--1.234
--1.234
+NULL
+NULL
 -- Iteration 5 --
--2
--2
--2
+int(5)
+int(5)
 -- Iteration 6 --
-2
-2
-2
+float(-0.9)
+float(-0.9)
 -- Iteration 7 --
--0.5
--0.5
--0.5
+float(-4.9999999)
+float(-4.9999999)
 -- Iteration 8 --
-0.567
-0.567
-0.567
+bool(false)
+bool(false)
 -- Iteration 9 --
--0.00067
--0.00067
--0.00067
+string(3) "SOA"
+string(3) "SOA"
 -- Iteration 10 --
--670
--670
--670
+array(0) {
+}
+array(0) {
+}
 -- Iteration 11 --
-670
-670
-670
+string(0) ""
+string(0) ""
 -- Iteration 12 --
-670
-670
-670
+string(1) " "
+string(1) " "
 -- Iteration 13 --
--0.00410003
--0.00410003
--0.00410003
+float(-2147483648)
+float(-2147483648)
 -- Iteration 14 --
--4100.03
--4100.03
--4100.03
+float(-2147483648)
+float(-2147483648)
 -- Iteration 15 --
-0.004100003
-0.004100003
-0.004100003
--- Iteration 16 --
-4100.003
-4100.003
-4100.003
--- Iteration 17 --
-100000
-100000
-100000
--- Iteration 18 --
--100000
--100000
--100000
--- Iteration 19 --
-1.0E-5
-1.0E-5
-1.0E-5
--- Iteration 20 --
--1.0E-5
--1.0E-5
--1.0E-5
--- Iteration 21 --
-100000
-100000
-100000
--- Iteration 22 --
--100000
--100000
--100000
--- Iteration 23 --
-100000
-100000
-100000
--- Iteration 24 --
--100000
--100000
--100000
--- Iteration 25 --
-100000
-100000
-100000
--- Iteration 26 --
--100000
--100000
--100000
--- Iteration 27 --
-1.0E-5
-1.0E-5
-1.0E-5
--- Iteration 28 --
--1.0E-5
--1.0E-5
--1.0E-5
--- Iteration 29 --
--2147483649
--2147483649
--2147483649
--- Iteration 30 --
-2147483649
-2147483649
-2147483649
--- Iteration 31 --
-2147483649
-2147483649
-2147483649
--- Iteration 32 --
--2147483649
--2147483649
--2147483649
-*** Testing print_r() on string variables ***
-
--- Iteration 1 --
-
+float(2)
+float(2)
+
+*** Testing end() with sub-arrays ***
+array(3) {
+  [1]=>
+  string(3) "one"
+  ["two"]=>
+  int(2)
+  [""]=>
+  string(1) "f"
+}
+string(1) "f"
 
+*** Testing end() when array elements are deleted ***
 
--- Iteration 2 --
+-- Remove first element from array --
+string(7) "neg.008"
 
+-- Remove last element from array --
+int(-4)
+int(-4)
 
+-- Remove any element from array apart from first and last element --
+int(-4)
+string(1) "b"
+int(-4)
 
--- Iteration 3 --
--- Iteration 4 --
--- Iteration 5 --
-0
-0
-0
--- Iteration 6 --
-\0
-\0
-\0
--- Iteration 7 --
-\0
-\0
-\0
--- Iteration 8 --
-       
-       
-       
--- Iteration 9 --
-\t
-\t
-\t
--- Iteration 10 --
-PHP
-PHP
-PHP
--- Iteration 11 --
-PHP
-PHP
-PHP
--- Iteration 12 --
-abcd\0n1234\005678\000efgh\xijkl
-abcd\0n1234\005678\000efgh\xijkl
-abcd\0n1234\005678\000efgh\xijkl
--- Iteration 13 --
-abcd\0efgh\0ijkl\0mnop\00qrst\0uvwx\00yz
-abcd\0efgh\0ijkl\0mnop\00qrst\0uvwx\00yz
-abcd\0efgh\0ijkl\0mnop\00qrst\0uvwx\00yz
--- Iteration 14 --
-1234   
-5678
-       9100
-abcda
-1234   
-5678
-       9100
-abcda
-1234   
-5678
-       9100
-abcda
-*** Testing print_r() on boolean variables ***
-
--- Iteration 1 --
-1
-1
-1
--- Iteration 2 --
-
-
+*** Testing end() on objects ***
+object(foo1)#%d (0) {
+}
+array(2) {
+  [0]=>
+  &object(foo)#%d (0) {
+  }
+  [1]=>
+  &object(foo1)#%d (0) {
+  }
+}
 
--- Iteration 3 --
-1
-1
-1
--- Iteration 4 --
+*** Testing end() on resource type ***
+resource(%d) of type (stream)
+resource(%d) of type (stream)
 
+*** Testing error conditions ***
 
-bool(true)
+Warning: end() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
 
-bool(true)
+Warning: end() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
 
-*** Testing print_r() on array variables ***
+Warning: end() expects parameter 1 to be array, integer given in %s on line %d
+NULL
 
+Warning: end() expects parameter 1 to be array, string given in %s on line %d
+NULL
+bool(false)
+Done
+--UEXPECTF--
+*** Testing end() on different arrays ***
 -- Iteration 1 --
-Array
-(
-)
-
-Array
-(
-)
-
-Array
-(
-)
-
+int(0)
+int(0)
 -- Iteration 2 --
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
+int(100)
+int(100)
 -- Iteration 3 --
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
+unicode(1) "y"
+unicode(1) "y"
 -- Iteration 4 --
-Array
-(
-    [0] => 1
-)
-
-Array
-(
-    [0] => 1
-)
-
-Array
-(
-    [0] => 1
-)
-
+NULL
+NULL
 -- Iteration 5 --
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
+int(5)
+int(5)
 -- Iteration 6 --
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
-Array
-(
-    [0] => 
-)
-
+float(-0.9)
+float(-0.9)
 -- Iteration 7 --
-Array
-(
-    [0] => Array
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-)
-
-Array
-(
-    [0] => Array
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-)
-
-Array
-(
-    [0] => Array
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-)
-
+float(-4.9999999)
+float(-4.9999999)
 -- Iteration 8 --
-Array
-(
-    [0] => Array
-        (
-            [0] => 1
-            [1] => 2
-        )
-
-    [1] => Array
-        (
-            [0] => a
-            [1] => b
-        )
-
-)
-
-Array
-(
-    [0] => Array
-        (
-            [0] => 1
-            [1] => 2
-        )
-
-    [1] => Array
-        (
-            [0] => a
-            [1] => b
-        )
-
-)
-
-Array
-(
-    [0] => Array
-        (
-            [0] => 1
-            [1] => 2
-        )
-
-    [1] => Array
-        (
-            [0] => a
-            [1] => b
-        )
-
-)
-
+bool(false)
+bool(false)
 -- Iteration 9 --
-Array
-(
-    [1] => One
-)
-
-Array
-(
-    [1] => One
-)
-
-Array
-(
-    [1] => One
-)
-
+unicode(3) "SOA"
+unicode(3) "SOA"
 -- Iteration 10 --
-Array
-(
-    [test] => is_array
-)
-
-Array
-(
-    [test] => is_array
-)
-
-Array
-(
-    [test] => is_array
-)
-
+array(0) {
+}
+array(0) {
+}
 -- Iteration 11 --
-Array
-(
-    [0] => 0
-)
-
-Array
-(
-    [0] => 0
-)
-
-Array
-(
-    [0] => 0
-)
-
+unicode(0) ""
+unicode(0) ""
 -- Iteration 12 --
-Array
-(
-    [0] => -1
-)
-
-Array
-(
-    [0] => -1
-)
-
-Array
-(
-    [0] => -1
-)
-
+unicode(1) " "
+unicode(1) " "
 -- Iteration 13 --
-Array
-(
-    [0] => 10.5
-    [1] => 5.6
-)
-
-Array
-(
-    [0] => 10.5
-    [1] => 5.6
-)
-
-Array
-(
-    [0] => 10.5
-    [1] => 5.6
-)
-
+float(-2147483648)
+float(-2147483648)
 -- Iteration 14 --
-Array
-(
-    [0] => string
-    [1] => test
-)
-
-Array
-(
-    [0] => string
-    [1] => test
-)
-
-Array
-(
-    [0] => string
-    [1] => test
-)
-
+float(-2147483648)
+float(-2147483648)
 -- Iteration 15 --
-Array
-(
-    [0] => string
-    [1] => test
-)
-
-Array
-(
-    [0] => string
-    [1] => test
-)
-
-Array
-(
-    [0] => string
-    [1] => test
-)
-
--- Iteration 16 --
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
-*** Testing print_r() on object variables ***
-
--- Iteration 1 --
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
--- Iteration 2 --
-no_member_class Object
-(
-)
-
-no_member_class Object
-(
-)
-
-no_member_class Object
-(
-)
-
--- Iteration 3 --
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
--- Iteration 4 --
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
-contains_object_class Object
-(
-    [p] => 30
-    [class_object1] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object2] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object3:contains_object_class:private] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [class_object4:protected] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-        )
-
-    [no_member_class_object] => no_member_class Object
-        (
-        )
-
-    [class_object5] => contains_object_class Object
- *RECURSION*
-)
-
--- Iteration 5 --
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
--- Iteration 6 --
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
--- Iteration 7 --
-no_member_class Object
-(
-)
-
-no_member_class Object
-(
-)
-
-no_member_class Object
-(
-)
-
--- Iteration 8 --
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-)
-
--- Iteration 9 --
-
-
-
-** Testing print_r() on objects having circular reference **
-object_class Object
-(
-    [value] => 50
-    [public_var1] => 10
-    [private_var1:object_class:private] => 20
-    [private_var2:object_class:private] => 21
-    [protected_var1:protected] => string_1
-    [protected_var2:protected] => string_2
-    [public_var2] => 11
-    [obj] => object_class Object
-        (
-            [value] => 50
-            [public_var1] => 10
-            [private_var1:object_class:private] => 20
-            [private_var2:object_class:private] => 21
-            [protected_var1:protected] => string_1
-            [protected_var2:protected] => string_2
-            [public_var2] => 11
-            [obj] => object_class Object
- *RECURSION*
-        )
-
-)
-
-*** Testing print_r() on resources ***
-
--- Iteration 1 --
-Resource id #%d
-Resource id #%d
-Resource id #%d
--- Iteration 2 --
-Resource id #%d
-Resource id #%d
-Resource id #%d
-*** Testing print_r() on different combinations of scalar 
-            and non-scalar variables ***
-
--- Iteration 1 --
-Array
-(
-    [0] => 123
-    [1] => -1.2345
-    [2] => a
-)
-
-Array
-(
-    [0] => 123
-    [1] => -1.2345
-    [2] => a
-)
-
-Array
-(
-    [0] => 123
-    [1] => -1.2345
-    [2] => a
-)
-
--- Iteration 2 --
-Array
-(
-    [0] => d
-    [1] => Array
-        (
-            [0] => 1
-            [1] => 3
-            [2] => 5
-        )
-
-    [2] => 1
-    [3] => 
-)
-
-Array
-(
-    [0] => d
-    [1] => Array
-        (
-            [0] => 1
-            [1] => 3
-            [2] => 5
-        )
-
-    [2] => 1
-    [3] => 
-)
-
-Array
-(
-    [0] => d
-    [1] => Array
-        (
-            [0] => 1
-            [1] => 3
-            [2] => 5
-        )
-
-    [2] => 1
-    [3] => 
-)
-
--- Iteration 3 --
-Array
-(
-    [0] => no_member_class Object
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-    [2] => 
-    [3] => 0
-)
-
-Array
-(
-    [0] => no_member_class Object
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-    [2] => 
-    [3] => 0
-)
-
-Array
-(
-    [0] => no_member_class Object
-        (
-        )
-
-    [1] => Array
-        (
-        )
-
-    [2] => 
-    [3] => 0
-)
-
--- Iteration 4 --
-Array
-(
-    [0] => 0
-    [1] => Where am I?
-    [2] => Array
-        (
-            [0] => 7
-            [1] => 8
-            [2] => 9
-        )
-
-    [3] => 1
-    [4] => A
-    [5] => 987654321
-)
-
-Array
-(
-    [0] => 0
-    [1] => Where am I?
-    [2] => Array
-        (
-            [0] => 7
-            [1] => 8
-            [2] => 9
-        )
-
-    [3] => 1
-    [4] => A
-    [5] => 987654321
-)
-
-Array
-(
-    [0] => 0
-    [1] => Where am I?
-    [2] => Array
-        (
-            [0] => 7
-            [1] => 8
-            [2] => 9
-        )
-
-    [3] => 1
-    [4] => A
-    [5] => 987654321
-)
-
--- Iteration 5 --
-Array
-(
-    [0] => 
-    [1] => 20000000000
-    [2] => 79.1
-    [3] => 4.599998
-)
-
-Array
-(
-    [0] => 
-    [1] => 20000000000
-    [2] => 79.1
-    [3] => 4.599998
-)
-
-Array
-(
-    [0] => 
-    [1] => 20000000000
-    [2] => 79.1
-    [3] => 4.599998
-)
-
--- Iteration 6 --
-Array
-(
-    [0] => array(1,2,3,4)1.0000002TRUE
-    [1] => 
-    [2] => 4611333
-    [3] => /00\7
-)
-
-Array
-(
-    [0] => array(1,2,3,4)1.0000002TRUE
-    [1] => 
-    [2] => 4611333
-    [3] => /00\7
-)
-
-Array
-(
-    [0] => array(1,2,3,4)1.0000002TRUE
-    [1] => 
-    [2] => 4611333
-    [3] => /00\7
-)
-
-*** Testing print_r() on miscelleneous input arguments ***
-
--- Iteration 1 --
-
-
-
--- Iteration 2 --
-
+float(2)
+float(2)
+
+*** Testing end() with sub-arrays ***
+array(3) {
+  [1]=>
+  unicode(3) "one"
+  [u"two"]=>
+  int(2)
+  [u""]=>
+  unicode(1) "f"
+}
+unicode(1) "f"
 
+*** Testing end() when array elements are deleted ***
 
--- Iteration 3 --
+-- Remove first element from array --
+unicode(7) "neg.008"
 
+-- Remove last element from array --
+int(-4)
+int(-4)
 
+-- Remove any element from array apart from first and last element --
+int(-4)
+unicode(1) "b"
+int(-4)
 
--- Iteration 4 --
+*** Testing end() on objects ***
+object(foo1)#%d (0) {
+}
+array(2) {
+  [0]=>
+  &object(foo)#%d (0) {
+  }
+  [1]=>
+  &object(foo1)#%d (0) {
+  }
+}
 
+*** Testing end() on resource type ***
+resource(%d) of type (stream)
+resource(%d) of type (stream)
 
+*** Testing error conditions ***
 
-*** Testing print_r() on anonymous functions ***
-New anonymous function: \0lambda_1
-2 * 3 = 6\0lambda_2
+Warning: end() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
 
-*** Testing error conditions ***
+Warning: end() expects exactly 1 parameter, 2 given in %s on line %d
+NULL
 
-Warning: print_r() expects at least 1 parameter, 0 given in %s on line %d
-bool(false)
+Warning: end() expects parameter 1 to be array, integer given in %s on line %d
+NULL
 
-Warning: print_r() expects at most 2 parameters, 3 given in %s on line %d
+Warning: end() expects parameter 1 to be array, Unicode string given in %s on line %d
+NULL
 bool(false)
-
-Notice: Undefined variable: value in %s on line %d
-string(0) ""
 Done
index 9b70e7f1b610b26ec1be39e14f53c2d3f9e36635..3d9e6b29cdc2c6d00d62c2564da3eb8b57828efe 100644 (file)
Binary files a/ext/standard/tests/general_functions/debug_zval_dump_b.phpt and b/ext/standard/tests/general_functions/debug_zval_dump_b.phpt differ
index df0465c9d4e84659cf60989bb7dd333be3535130..8d506dc9ffc0918473ff1a2621d424866db1f742 100644 (file)
@@ -1,7 +1,12 @@
 --TEST--
 Test print_r() function
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--INI--
+precision=14
 --FILE--
-
 <?php
 /* Prototype: bool print_r ( mixed $expression [, bool $return] );
    Description: Prints human-readable information about a variable
@@ -135,7 +140,6 @@ $arrays = array (
   array(10.5, 5.6),
   array("string", "test"),
   array('string', 'test'),
-  $array1 = array(1,2,3,4, &$array1)  // recursive array
 );
 /* calling check_printr() to display contents of $arrays */
 check_printr($arrays);
@@ -955,61 +959,6 @@ Array
     [1] => test
 )
 
--- Iteration 16 --
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
-Array
-(
-    [0] => 1
-    [1] => 2
-    [2] => 3
-    [3] => 4
-    [4] => Array
-        (
-            [0] => 1
-            [1] => 2
-            [2] => 3
-            [3] => 4
-            [4] => Array
- *RECURSION*
-        )
-
-)
-
 *** Testing print_r() on object variables ***
 
 -- Iteration 1 --
@@ -1538,13 +1487,13 @@ object_class Object
 *** Testing print_r() on resources ***
 
 -- Iteration 1 --
-Resource id #%d
-Resource id #%d
-Resource id #%d
+Resource id #5
+Resource id #5
+Resource id #5
 -- Iteration 2 --
-Resource id #%d
-Resource id #%d
-Resource id #%d
+Resource id #6
+Resource id #6
+Resource id #6
 *** Testing print_r() on different combinations of scalar 
             and non-scalar variables ***
 
index 377cae1ef043a3f682cf7a7484a2db3888ffd0bc..6b76cd0e3159121cc9a2d433ece8a2063a935f3b 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Test strval() function
+--INI--
+precision=14
 --FILE--
 <?php
 /* Prototype: string strval ( mixed $var );
@@ -306,3 +308,163 @@ NULL
 Warning: Wrong parameter count for strval() in %s on line %d
 NULL
 Done
+--UEXPECTF--
+*** Testing str_val() with scalar values***
+-- Iteration 1 --
+unicode(1) "0"
+-- Iteration 2 --
+unicode(1) "1"
+-- Iteration 3 --
+unicode(2) "-1"
+-- Iteration 4 --
+unicode(11) "-2147483648"
+-- Iteration 5 --
+unicode(11) "-2147483647"
+-- Iteration 6 --
+unicode(10) "2147483647"
+-- Iteration 7 --
+unicode(10) "2147483640"
+-- Iteration 8 --
+unicode(4) "4667"
+-- Iteration 9 --
+unicode(4) "4779"
+-- Iteration 10 --
+unicode(4) "4095"
+-- Iteration 11 --
+unicode(3) "250"
+-- Iteration 12 --
+unicode(11) "-2147483648"
+-- Iteration 13 --
+unicode(10) "2147483647"
+-- Iteration 14 --
+unicode(10) "2147483647"
+-- Iteration 15 --
+unicode(2) "83"
+-- Iteration 16 --
+unicode(1) "1"
+-- Iteration 17 --
+unicode(11) "-2147483648"
+-- Iteration 18 --
+unicode(10) "2147483647"
+-- Iteration 19 --
+unicode(11) "-2147483649"
+-- Iteration 20 --
+unicode(10) "2147483648"
+-- Iteration 21 --
+unicode(11) "-2147483649"
+-- Iteration 22 --
+unicode(11) "34359738369"
+-- Iteration 23 --
+unicode(10) "2147483649"
+-- Iteration 24 --
+unicode(11) "-2147483649"
+-- Iteration 25 --
+unicode(1) "0"
+-- Iteration 26 --
+unicode(4) "-0.1"
+-- Iteration 27 --
+unicode(2) "10"
+-- Iteration 28 --
+unicode(7) "1050000"
+-- Iteration 29 --
+unicode(6) "1.0E-5"
+-- Iteration 30 --
+unicode(7) "5000000"
+-- Iteration 31 --
+unicode(7) "6.0E-20"
+-- Iteration 32 --
+unicode(7) "5.0E+42"
+-- Iteration 33 --
+unicode(7) "3.4E-33"
+-- Iteration 34 --
+unicode(1) "1"
+-- Iteration 35 --
+unicode(1) "1"
+-- Iteration 36 --
+unicode(0) ""
+-- Iteration 37 --
+unicode(0) ""
+-- Iteration 38 --
+unicode(0) ""
+-- Iteration 39 --
+unicode(0) ""
+-- Iteration 40 --
+unicode(1) " "
+-- Iteration 41 --
+unicode(1) " "
+-- Iteration 42 --
+unicode(1) "0"
+-- Iteration 43 --
+unicode(1) "0"
+-- Iteration 44 --
+unicode(7) "testing"
+-- Iteration 45 --
+unicode(5) "0x564"
+-- Iteration 46 --
+unicode(4) "0123"
+-- Iteration 47 --
+unicode(4) "new
+"
+-- Iteration 48 --
+unicode(5) "new\n"
+-- Iteration 49 --
+unicode(11) "@#$$%^&&*()"
+-- Iteration 50 --
+unicode(8) "        "
+-- Iteration 51 --
+unicode(4) "null"
+-- Iteration 52 --
+unicode(4) "null"
+-- Iteration 53 --
+unicode(4) "true"
+-- Iteration 54 --
+unicode(4) "true"
+-- Iteration 55 --
+unicode(54) "This is a multiline heredoc
+string. Numeric = 1232455."
+-- Iteration 56 --
+unicode(10) "12345
+2345"
+-- Iteration 57 --
+unicode(0) ""
+
+*** Testing strval() with non_scalar values ***
+-- Iteration 1 --
+unicode(6) "Object"
+-- Iteration 2 --
+unicode(%d) "Resource id #%d"
+-- Iteration 3 --
+unicode(%d) "Resource id #%d"
+-- Iteration 4 --
+
+Notice: Array to string conversion in %s on line %d
+unicode(5) "Array"
+-- Iteration 5 --
+
+Notice: Array to string conversion in %s on line %d
+unicode(5) "Array"
+-- Iteration 6 --
+
+Notice: Array to string conversion in %s on line %d
+unicode(5) "Array"
+-- Iteration 7 --
+
+Notice: Array to string conversion in %s on line %d
+unicode(5) "Array"
+-- Iteration 8 --
+unicode(0) ""
+-- Iteration 9 --
+unicode(0) ""
+-- Iteration 10 --
+unicode(0) ""
+-- Iteration 11 --
+unicode(0) ""
+
+*** Testing error conditions ***
+
+Warning: Wrong parameter count for strval() in %s on line %d
+NULL
+
+Warning: Wrong parameter count for strval() in %s on line %d
+NULL
+Done
index 9adf3f92afcc5a853ca84495be59d42bbe99c395..b33069db47c65b39aa4177839d2acd0b245d3e05 100644 (file)
@@ -1,7 +1,12 @@
 --TEST--
 Test var_dump() function
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--INI--
+precision=14
 --FILE--
-
 <?php
 /* Prototype: void var_dump ( mixed $expression [, mixed $expression [, $...]] );
    Description: Displays structured information about one or more expressions that includes its type and value.
@@ -13,7 +18,7 @@ function check_vardump( $variables ) {
   $counter = 1;
   foreach( $variables as $variable ) {
     echo "-- Iteration $counter --\n";
-    var_dump( $variable );
+    var_dump($variable);
     $counter++;
   }
 }
@@ -36,7 +41,7 @@ $integers = array (
   017777777777,  // max posotive octal integer
   -020000000000  // min range of octal integer
 );                 
-/* calling check_vardump() to display contents of integer variables
+/* calling check_vardump() to display contents of integer variables 
    using var_dump() */
 check_vardump($integers);
 
@@ -75,7 +80,7 @@ $floats = array (
   020000000001,  // float value, beyond max positive int
   -020000000001  // float value, beyond max negative int 
 );
-/* calling check_vardump() to display contents of float variables
+/* calling check_vardump() to display contents of float variables 
    using var_dump() */
 check_vardump($floats);
 
@@ -96,7 +101,7 @@ $strings = array (
   "abcd\0efgh\0ijkl\x00mnop\x000qrst\00uvwx\0000yz",  // strings with octal NULL
   "1234\t\n5678\n\t9100\rabcda"  // strings with escape characters
 );
-/* calling check_vardump() to display contents of strings
+/* calling check_vardump() to display contents of strings 
    using var_dump() */
 check_vardump($strings);
 
@@ -128,7 +133,6 @@ $arrays = array (
   array(10.5, 5.6),
   array("string", "test"),
   array('string', 'test'),
-  $array1 = array(1,2,3,4, &$array1)  // recursive array
 );
 /* calling check_vardump() to display contents of an array
    using var_dump() */
@@ -283,7 +287,7 @@ echo "\n*** Testing error conditions ***\n";
 var_dump();
 
 /* closing resource handle used */
-closedir($dir_handle);
+closedir($dir_handle); 
 
 echo "Done\n";
 ?>
@@ -567,41 +571,6 @@ array(2) {
   [1]=>
   string(4) "test"
 }
--- Iteration 16 --
-array(5) {
-  [0]=>
-  int(1)
-  [1]=>
-  int(2)
-  [2]=>
-  int(3)
-  [3]=>
-  int(4)
-  [4]=>
-  &array(5) {
-    [0]=>
-    int(1)
-    [1]=>
-    int(2)
-    [2]=>
-    int(3)
-    [3]=>
-    int(4)
-    [4]=>
-    &array(5) {
-      [0]=>
-      int(1)
-      [1]=>
-      int(2)
-      [2]=>
-      int(3)
-      [3]=>
-      int(4)
-      [4]=>
-      *RECURSION*
-    }
-  }
-}
 
 *** Testing var_dump() on object variables ***
 -- Iteration 1 --
@@ -1337,7 +1306,7 @@ array(14) {
        9100
 abcda"
 }
-array(16) {
+array(15) {
   [0]=>
   array(0) {
   }
@@ -1433,41 +1402,6 @@ array(16) {
     [1]=>
     string(4) "test"
   }
-  [15]=>
-  array(5) {
-    [0]=>
-    int(1)
-    [1]=>
-    int(2)
-    [2]=>
-    int(3)
-    [3]=>
-    int(4)
-    [4]=>
-    &array(5) {
-      [0]=>
-      int(1)
-      [1]=>
-      int(2)
-      [2]=>
-      int(3)
-      [3]=>
-      int(4)
-      [4]=>
-      &array(5) {
-        [0]=>
-        int(1)
-        [1]=>
-        int(2)
-        [2]=>
-        int(3)
-        [3]=>
-        int(4)
-        [4]=>
-        *RECURSION*
-      }
-    }
-  }
 }
 array(4) {
   [0]=>
@@ -1977,3 +1911,1623 @@ string(9) "\0lambda_2"
 
 Warning: Wrong parameter count for var_dump() in %s on line %d
 Done
+--UEXPECTF--
+*** Testing var_dump() on integer variables ***
+-- Iteration 1 --
+int(0)
+-- Iteration 2 --
+int(83)
+-- Iteration 3 --
+int(123000000)
+-- Iteration 4 --
+int(-83)
+-- Iteration 5 --
+int(-12300000)
+-- Iteration 6 --
+array(10) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+  [3]=>
+  int(4)
+  [4]=>
+  int(5)
+  [5]=>
+  int(6)
+  [6]=>
+  int(7)
+  [7]=>
+  int(8)
+  [8]=>
+  int(9)
+  [9]=>
+  int(10)
+}
+-- Iteration 7 --
+array(10) {
+  [0]=>
+  int(-1)
+  [1]=>
+  int(-2)
+  [2]=>
+  int(-3)
+  [3]=>
+  int(-4)
+  [4]=>
+  int(-5)
+  [5]=>
+  int(-6)
+  [6]=>
+  int(-7)
+  [7]=>
+  int(-8)
+  [8]=>
+  int(-9)
+  [9]=>
+  int(-10)
+}
+-- Iteration 8 --
+int(2147483647)
+-- Iteration 9 --
+float(2147483648)
+-- Iteration 10 --
+float(-2147483648)
+-- Iteration 11 --
+int(-2147483647)
+-- Iteration 12 --
+int(2147483647)
+-- Iteration 13 --
+float(-2147483648)
+-- Iteration 14 --
+int(2147483647)
+-- Iteration 15 --
+float(-2147483648)
+
+*** Testing var_dump() on float variables ***
+-- Iteration 1 --
+float(0)
+-- Iteration 2 --
+float(0)
+-- Iteration 3 --
+float(1.234)
+-- Iteration 4 --
+float(-1.234)
+-- Iteration 5 --
+float(-2)
+-- Iteration 6 --
+float(2)
+-- Iteration 7 --
+float(-0.5)
+-- Iteration 8 --
+float(0.567)
+-- Iteration 9 --
+float(-0.00067)
+-- Iteration 10 --
+float(-670)
+-- Iteration 11 --
+float(670)
+-- Iteration 12 --
+float(670)
+-- Iteration 13 --
+float(-0.00410003)
+-- Iteration 14 --
+float(-4100.03)
+-- Iteration 15 --
+float(0.004100003)
+-- Iteration 16 --
+float(4100.003)
+-- Iteration 17 --
+float(100000)
+-- Iteration 18 --
+float(-100000)
+-- Iteration 19 --
+float(1.0E-5)
+-- Iteration 20 --
+float(-1.0E-5)
+-- Iteration 21 --
+float(100000)
+-- Iteration 22 --
+float(-100000)
+-- Iteration 23 --
+float(100000)
+-- Iteration 24 --
+float(-100000)
+-- Iteration 25 --
+float(100000)
+-- Iteration 26 --
+float(-100000)
+-- Iteration 27 --
+float(1.0E-5)
+-- Iteration 28 --
+float(-1.0E-5)
+-- Iteration 29 --
+float(-2147483649)
+-- Iteration 30 --
+float(2147483649)
+-- Iteration 31 --
+float(2147483649)
+-- Iteration 32 --
+float(-2147483649)
+
+*** Testing var_dump() on string variables ***
+-- Iteration 1 --
+unicode(0) ""
+-- Iteration 2 --
+unicode(0) ""
+-- Iteration 3 --
+unicode(1) " "
+-- Iteration 4 --
+unicode(1) " "
+-- Iteration 5 --
+unicode(1) "0"
+-- Iteration 6 --
+unicode(1) "\0"
+-- Iteration 7 --
+unicode(2) "\0"
+-- Iteration 8 --
+unicode(1) "   "
+-- Iteration 9 --
+unicode(2) "\t"
+-- Iteration 10 --
+unicode(3) "PHP"
+-- Iteration 11 --
+unicode(3) "PHP"
+-- Iteration 12 --
+unicode(29) "abcd\0n1234\005678\000efgh\xijkl"
+-- Iteration 13 --
+unicode(34) "abcd\0efgh\0ijkl\0mnop\00qrst\0uvwx\00yz"
+-- Iteration 14 --
+unicode(22) "1234      
+5678
+       9100
+abcda"
+
+*** Testing var_dump() on boolean variables ***
+-- Iteration 1 --
+bool(true)
+-- Iteration 2 --
+bool(false)
+-- Iteration 3 --
+bool(true)
+-- Iteration 4 --
+bool(false)
+
+*** Testing var_dump() on array variables ***
+-- Iteration 1 --
+array(0) {
+}
+-- Iteration 2 --
+array(1) {
+  [0]=>
+  NULL
+}
+-- Iteration 3 --
+array(1) {
+  [0]=>
+  NULL
+}
+-- Iteration 4 --
+array(1) {
+  [0]=>
+  bool(true)
+}
+-- Iteration 5 --
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+-- Iteration 6 --
+array(1) {
+  [0]=>
+  unicode(0) ""
+}
+-- Iteration 7 --
+array(2) {
+  [0]=>
+  array(0) {
+  }
+  [1]=>
+  array(0) {
+  }
+}
+-- Iteration 8 --
+array(2) {
+  [0]=>
+  array(2) {
+    [0]=>
+    int(1)
+    [1]=>
+    int(2)
+  }
+  [1]=>
+  array(2) {
+    [0]=>
+    unicode(1) "a"
+    [1]=>
+    unicode(1) "b"
+  }
+}
+-- Iteration 9 --
+array(1) {
+  [1]=>
+  unicode(3) "One"
+}
+-- Iteration 10 --
+array(1) {
+  [u"test"]=>
+  unicode(8) "is_array"
+}
+-- Iteration 11 --
+array(1) {
+  [0]=>
+  int(0)
+}
+-- Iteration 12 --
+array(1) {
+  [0]=>
+  int(-1)
+}
+-- Iteration 13 --
+array(2) {
+  [0]=>
+  float(10.5)
+  [1]=>
+  float(5.6)
+}
+-- Iteration 14 --
+array(2) {
+  [0]=>
+  unicode(6) "string"
+  [1]=>
+  unicode(4) "test"
+}
+-- Iteration 15 --
+array(2) {
+  [0]=>
+  unicode(6) "string"
+  [1]=>
+  unicode(4) "test"
+}
+
+*** Testing var_dump() on object variables ***
+-- Iteration 1 --
+object(object_class)#%d (7) {
+  [u"value"]=>
+  int(50)
+  [u"public_var1"]=>
+  int(10)
+  [u"private_var1":u"object_class":private]=>
+  int(20)
+  [u"private_var2":u"object_class":private]=>
+  int(21)
+  [u"protected_var1":protected]=>
+  unicode(8) "string_1"
+  [u"protected_var2":protected]=>
+  unicode(8) "string_2"
+  [u"public_var2"]=>
+  int(11)
+}
+-- Iteration 2 --
+object(no_member_class)#%d (0) {
+}
+-- Iteration 3 --
+object(contains_object_class)#%d (7) {
+  [u"p"]=>
+  int(30)
+  [u"class_object1"]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object2"]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object3":u"contains_object_class":private]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object4":protected]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"no_member_class_object"]=>
+  object(no_member_class)#%d (0) {
+  }
+  [u"class_object5"]=>
+  object(contains_object_class)#%d (7) {
+    [u"p"]=>
+    int(30)
+    [u"class_object1"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object2"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object3":u"contains_object_class":private]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object4":protected]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"no_member_class_object"]=>
+    object(no_member_class)#%d (0) {
+    }
+    [u"class_object5"]=>
+    *RECURSION*
+  }
+}
+-- Iteration 4 --
+object(contains_object_class)#%d (7) {
+  [u"p"]=>
+  int(30)
+  [u"class_object1"]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object2"]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object3":u"contains_object_class":private]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"class_object4":protected]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [u"no_member_class_object"]=>
+  object(no_member_class)#%d (0) {
+  }
+  [u"class_object5"]=>
+  object(contains_object_class)#%d (7) {
+    [u"p"]=>
+    int(30)
+    [u"class_object1"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object2"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object3":u"contains_object_class":private]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object4":protected]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"no_member_class_object"]=>
+    object(no_member_class)#%d (0) {
+    }
+    [u"class_object5"]=>
+    *RECURSION*
+  }
+}
+-- Iteration 5 --
+object(object_class)#%d (7) {
+  [u"value"]=>
+  int(50)
+  [u"public_var1"]=>
+  int(10)
+  [u"private_var1":u"object_class":private]=>
+  int(20)
+  [u"private_var2":u"object_class":private]=>
+  int(21)
+  [u"protected_var1":protected]=>
+  unicode(8) "string_1"
+  [u"protected_var2":protected]=>
+  unicode(8) "string_2"
+  [u"public_var2"]=>
+  int(11)
+}
+-- Iteration 6 --
+object(object_class)#%d (7) {
+  [u"value"]=>
+  int(50)
+  [u"public_var1"]=>
+  int(10)
+  [u"private_var1":u"object_class":private]=>
+  int(20)
+  [u"private_var2":u"object_class":private]=>
+  int(21)
+  [u"protected_var1":protected]=>
+  unicode(8) "string_1"
+  [u"protected_var2":protected]=>
+  unicode(8) "string_2"
+  [u"public_var2"]=>
+  int(11)
+}
+-- Iteration 7 --
+object(no_member_class)#%d (0) {
+}
+-- Iteration 8 --
+object(object_class)#%d (7) {
+  [u"value"]=>
+  int(50)
+  [u"public_var1"]=>
+  int(10)
+  [u"private_var1":u"object_class":private]=>
+  int(20)
+  [u"private_var2":u"object_class":private]=>
+  int(21)
+  [u"protected_var1":protected]=>
+  unicode(8) "string_1"
+  [u"protected_var2":protected]=>
+  unicode(8) "string_2"
+  [u"public_var2"]=>
+  int(11)
+}
+-- Iteration 9 --
+NULL
+
+** Testing var_dump() on objects having circular reference **
+object(object_class)#%d (8) {
+  [u"value"]=>
+  int(50)
+  [u"public_var1"]=>
+  int(10)
+  [u"private_var1":u"object_class":private]=>
+  int(20)
+  [u"private_var2":u"object_class":private]=>
+  int(21)
+  [u"protected_var1":protected]=>
+  unicode(8) "string_1"
+  [u"protected_var2":protected]=>
+  unicode(8) "string_2"
+  [u"public_var2"]=>
+  int(11)
+  [u"obj"]=>
+  &object(object_class)#%d (8) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+    [u"obj"]=>
+    &object(object_class)#%d (8) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+      [u"obj"]=>
+      &object(object_class)#%d (8) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+        [u"obj"]=>
+        *RECURSION*
+      }
+    }
+  }
+}
+
+*** Testing var_dump() on resources ***
+-- Iteration 1 --
+resource(%d) of type (stream)
+-- Iteration 2 --
+resource(%d) of type (stream)
+
+*** Testing var_dump() on different combinations of scalar 
+            and non-scalar variables ***
+-- Iteration 1 --
+array(3) {
+  [0]=>
+  int(123)
+  [1]=>
+  float(-1.2345)
+  [2]=>
+  unicode(1) "a"
+}
+-- Iteration 2 --
+array(4) {
+  [0]=>
+  unicode(1) "d"
+  [1]=>
+  array(3) {
+    [0]=>
+    int(1)
+    [1]=>
+    int(3)
+    [2]=>
+    int(5)
+  }
+  [2]=>
+  bool(true)
+  [3]=>
+  NULL
+}
+-- Iteration 3 --
+array(4) {
+  [0]=>
+  object(no_member_class)#%d (0) {
+  }
+  [1]=>
+  array(0) {
+  }
+  [2]=>
+  bool(false)
+  [3]=>
+  int(0)
+}
+-- Iteration 4 --
+array(6) {
+  [0]=>
+  float(0)
+  [1]=>
+  unicode(11) "Where am I?"
+  [2]=>
+  array(3) {
+    [0]=>
+    int(7)
+    [1]=>
+    int(8)
+    [2]=>
+    int(9)
+  }
+  [3]=>
+  bool(true)
+  [4]=>
+  unicode(1) "A"
+  [5]=>
+  int(987654321)
+}
+-- Iteration 5 --
+array(4) {
+  [0]=>
+  NULL
+  [1]=>
+  float(20000000000)
+  [2]=>
+  float(79.1)
+  [3]=>
+  float(4.599998)
+}
+-- Iteration 6 --
+array(4) {
+  [0]=>
+  unicode(27) "array(1,2,3,4)1.0000002TRUE"
+  [1]=>
+  NULL
+  [2]=>
+  float(4611333)
+  [3]=>
+  unicode(5) "/00\7"
+}
+
+*** Testing var_dump() on miscelleneous input arguments ***
+-- Iteration 1 --
+NULL
+-- Iteration 2 --
+NULL
+-- Iteration 3 --
+NULL
+-- Iteration 4 --
+NULL
+
+*** Testing var_dump() on multiple arguments ***
+array(15) {
+  [0]=>
+  int(0)
+  [1]=>
+  int(83)
+  [2]=>
+  int(123000000)
+  [3]=>
+  int(-83)
+  [4]=>
+  int(-12300000)
+  [5]=>
+  array(10) {
+    [0]=>
+    int(1)
+    [1]=>
+    int(2)
+    [2]=>
+    int(3)
+    [3]=>
+    int(4)
+    [4]=>
+    int(5)
+    [5]=>
+    int(6)
+    [6]=>
+    int(7)
+    [7]=>
+    int(8)
+    [8]=>
+    int(9)
+    [9]=>
+    int(10)
+  }
+  [6]=>
+  array(10) {
+    [0]=>
+    int(-1)
+    [1]=>
+    int(-2)
+    [2]=>
+    int(-3)
+    [3]=>
+    int(-4)
+    [4]=>
+    int(-5)
+    [5]=>
+    int(-6)
+    [6]=>
+    int(-7)
+    [7]=>
+    int(-8)
+    [8]=>
+    int(-9)
+    [9]=>
+    int(-10)
+  }
+  [7]=>
+  int(2147483647)
+  [8]=>
+  float(2147483648)
+  [9]=>
+  float(-2147483648)
+  [10]=>
+  int(-2147483647)
+  [11]=>
+  int(2147483647)
+  [12]=>
+  float(-2147483648)
+  [13]=>
+  int(2147483647)
+  [14]=>
+  float(-2147483648)
+}
+array(32) {
+  [0]=>
+  float(0)
+  [1]=>
+  float(0)
+  [2]=>
+  float(1.234)
+  [3]=>
+  float(-1.234)
+  [4]=>
+  float(-2)
+  [5]=>
+  float(2)
+  [6]=>
+  float(-0.5)
+  [7]=>
+  float(0.567)
+  [8]=>
+  float(-0.00067)
+  [9]=>
+  float(-670)
+  [10]=>
+  float(670)
+  [11]=>
+  float(670)
+  [12]=>
+  float(-0.00410003)
+  [13]=>
+  float(-4100.03)
+  [14]=>
+  float(0.004100003)
+  [15]=>
+  float(4100.003)
+  [16]=>
+  float(100000)
+  [17]=>
+  float(-100000)
+  [18]=>
+  float(1.0E-5)
+  [19]=>
+  float(-1.0E-5)
+  [20]=>
+  float(100000)
+  [21]=>
+  float(-100000)
+  [22]=>
+  float(100000)
+  [23]=>
+  float(-100000)
+  [24]=>
+  float(100000)
+  [25]=>
+  float(-100000)
+  [26]=>
+  float(1.0E-5)
+  [27]=>
+  float(-1.0E-5)
+  [28]=>
+  float(-2147483649)
+  [29]=>
+  float(2147483649)
+  [30]=>
+  float(2147483649)
+  [31]=>
+  float(-2147483649)
+}
+array(14) {
+  [0]=>
+  unicode(0) ""
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) " "
+  [3]=>
+  unicode(1) " "
+  [4]=>
+  unicode(1) "0"
+  [5]=>
+  unicode(1) "\0"
+  [6]=>
+  unicode(2) "\0"
+  [7]=>
+  unicode(1) " "
+  [8]=>
+  unicode(2) "\t"
+  [9]=>
+  unicode(3) "PHP"
+  [10]=>
+  unicode(3) "PHP"
+  [11]=>
+  unicode(29) "abcd\0n1234\005678\000efgh\xijkl"
+  [12]=>
+  unicode(34) "abcd\0efgh\0ijkl\0mnop\00qrst\0uvwx\00yz"
+  [13]=>
+  unicode(22) "1234    
+5678
+       9100
+abcda"
+}
+array(15) {
+  [0]=>
+  array(0) {
+  }
+  [1]=>
+  array(1) {
+    [0]=>
+    NULL
+  }
+  [2]=>
+  array(1) {
+    [0]=>
+    NULL
+  }
+  [3]=>
+  array(1) {
+    [0]=>
+    bool(true)
+  }
+  [4]=>
+  array(1) {
+    [0]=>
+    unicode(0) ""
+  }
+  [5]=>
+  array(1) {
+    [0]=>
+    unicode(0) ""
+  }
+  [6]=>
+  array(2) {
+    [0]=>
+    array(0) {
+    }
+    [1]=>
+    array(0) {
+    }
+  }
+  [7]=>
+  array(2) {
+    [0]=>
+    array(2) {
+      [0]=>
+      int(1)
+      [1]=>
+      int(2)
+    }
+    [1]=>
+    array(2) {
+      [0]=>
+      unicode(1) "a"
+      [1]=>
+      unicode(1) "b"
+    }
+  }
+  [8]=>
+  array(1) {
+    [1]=>
+    unicode(3) "One"
+  }
+  [9]=>
+  array(1) {
+    [u"test"]=>
+    unicode(8) "is_array"
+  }
+  [10]=>
+  array(1) {
+    [0]=>
+    int(0)
+  }
+  [11]=>
+  array(1) {
+    [0]=>
+    int(-1)
+  }
+  [12]=>
+  array(2) {
+    [0]=>
+    float(10.5)
+    [1]=>
+    float(5.6)
+  }
+  [13]=>
+  array(2) {
+    [0]=>
+    unicode(6) "string"
+    [1]=>
+    unicode(4) "test"
+  }
+  [14]=>
+  array(2) {
+    [0]=>
+    unicode(6) "string"
+    [1]=>
+    unicode(4) "test"
+  }
+}
+array(4) {
+  [0]=>
+  bool(true)
+  [1]=>
+  bool(false)
+  [2]=>
+  bool(true)
+  [3]=>
+  bool(false)
+}
+array(2) {
+  [0]=>
+  resource(%d) of type (stream)
+  [1]=>
+  resource(%d) of type (stream)
+}
+array(9) {
+  [0]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [1]=>
+  object(no_member_class)#%d (0) {
+  }
+  [2]=>
+  object(contains_object_class)#%d (7) {
+    [u"p"]=>
+    int(30)
+    [u"class_object1"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object2"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object3":u"contains_object_class":private]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object4":protected]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"no_member_class_object"]=>
+    object(no_member_class)#%d (0) {
+    }
+    [u"class_object5"]=>
+    object(contains_object_class)#%d (7) {
+      [u"p"]=>
+      int(30)
+      [u"class_object1"]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object2"]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object3":u"contains_object_class":private]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object4":protected]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"no_member_class_object"]=>
+      object(no_member_class)#%d (0) {
+      }
+      [u"class_object5"]=>
+      *RECURSION*
+    }
+  }
+  [3]=>
+  object(contains_object_class)#%d (7) {
+    [u"p"]=>
+    int(30)
+    [u"class_object1"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object2"]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object3":u"contains_object_class":private]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"class_object4":protected]=>
+    object(object_class)#%d (7) {
+      [u"value"]=>
+      int(50)
+      [u"public_var1"]=>
+      int(10)
+      [u"private_var1":u"object_class":private]=>
+      int(20)
+      [u"private_var2":u"object_class":private]=>
+      int(21)
+      [u"protected_var1":protected]=>
+      unicode(8) "string_1"
+      [u"protected_var2":protected]=>
+      unicode(8) "string_2"
+      [u"public_var2"]=>
+      int(11)
+    }
+    [u"no_member_class_object"]=>
+    object(no_member_class)#%d (0) {
+    }
+    [u"class_object5"]=>
+    object(contains_object_class)#%d (7) {
+      [u"p"]=>
+      int(30)
+      [u"class_object1"]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object2"]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object3":u"contains_object_class":private]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"class_object4":protected]=>
+      object(object_class)#%d (7) {
+        [u"value"]=>
+        int(50)
+        [u"public_var1"]=>
+        int(10)
+        [u"private_var1":u"object_class":private]=>
+        int(20)
+        [u"private_var2":u"object_class":private]=>
+        int(21)
+        [u"protected_var1":protected]=>
+        unicode(8) "string_1"
+        [u"protected_var2":protected]=>
+        unicode(8) "string_2"
+        [u"public_var2"]=>
+        int(11)
+      }
+      [u"no_member_class_object"]=>
+      object(no_member_class)#%d (0) {
+      }
+      [u"class_object5"]=>
+      *RECURSION*
+    }
+  }
+  [4]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [5]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [6]=>
+  object(no_member_class)#%d (0) {
+  }
+  [7]=>
+  object(object_class)#%d (7) {
+    [u"value"]=>
+    int(50)
+    [u"public_var1"]=>
+    int(10)
+    [u"private_var1":u"object_class":private]=>
+    int(20)
+    [u"private_var2":u"object_class":private]=>
+    int(21)
+    [u"protected_var1":protected]=>
+    unicode(8) "string_1"
+    [u"protected_var2":protected]=>
+    unicode(8) "string_2"
+    [u"public_var2"]=>
+    int(11)
+  }
+  [8]=>
+  NULL
+}
+array(4) {
+  [0]=>
+  NULL
+  [1]=>
+  NULL
+  [2]=>
+  NULL
+  [3]=>
+  NULL
+}
+array(6) {
+  [0]=>
+  array(3) {
+    [0]=>
+    int(123)
+    [1]=>
+    float(-1.2345)
+    [2]=>
+    unicode(1) "a"
+  }
+  [1]=>
+  array(4) {
+    [0]=>
+    unicode(1) "d"
+    [1]=>
+    array(3) {
+      [0]=>
+      int(1)
+      [1]=>
+      int(3)
+      [2]=>
+      int(5)
+    }
+    [2]=>
+    bool(true)
+    [3]=>
+    NULL
+  }
+  [2]=>
+  array(4) {
+    [0]=>
+    object(no_member_class)#%d (0) {
+    }
+    [1]=>
+    array(0) {
+    }
+    [2]=>
+    bool(false)
+    [3]=>
+    int(0)
+  }
+  [3]=>
+  array(6) {
+    [0]=>
+    float(0)
+    [1]=>
+    unicode(11) "Where am I?"
+    [2]=>
+    array(3) {
+      [0]=>
+      int(7)
+      [1]=>
+      int(8)
+      [2]=>
+      int(9)
+    }
+    [3]=>
+    bool(true)
+    [4]=>
+    unicode(1) "A"
+    [5]=>
+    int(987654321)
+  }
+  [4]=>
+  array(4) {
+    [0]=>
+    NULL
+    [1]=>
+    float(20000000000)
+    [2]=>
+    float(79.1)
+    [3]=>
+    float(4.599998)
+  }
+  [5]=>
+  array(4) {
+    [0]=>
+    unicode(27) "array(1,2,3,4)1.0000002TRUE"
+    [1]=>
+    NULL
+    [2]=>
+    float(4611333)
+    [3]=>
+    unicode(5) "/00\7"
+  }
+}
+
+*** Testing var_dump() on anonymous functions ***
+New anonymous function: \0lambda_1
+unicode(9) "2 * 3 = 6"
+unicode(9) "\0lambda_2"
+
+*** Testing error conditions ***
+
+Warning: Wrong parameter count for var_dump() in %s on line %d
+Done
index 856d2e6525c4c624249db9deaac3752759a8c277..6011601372e17fb7c59a51c8717ce03474a4c092 100644 (file)
Binary files a/ext/standard/tests/strings/addcslashes.phpt and b/ext/standard/tests/strings/addcslashes.phpt differ
index c99365339c9f67ac35cf84ce9138f8f589f81f0f..48ba05a063e4a374c88a3b63346fa3e2398e9910 100644 (file)
Binary files a/ext/standard/tests/strings/implode1.phpt and b/ext/standard/tests/strings/implode1.phpt differ
index c8995d10dd8200150ac2338ad4d8fbb1e516c81d..a0d685c9cc93156a3501c4df02f821cd2308498f 100644 (file)
Binary files a/ext/standard/tests/strings/str_repeat.phpt and b/ext/standard/tests/strings/str_repeat.phpt differ
index 5105e5ada2f2345873ad05e9ee5fde0257b0b957..15b0f639ec70f89e7cd589cdfc1e5b2c23f85fae 100644 (file)
@@ -1,5 +1,7 @@
 --TEST--
 Test str_replace() function
+--INI--
+precision=14
 --FILE--
 <?php
 /* 
@@ -246,7 +248,7 @@ string(1) "q"
 int(1)
 string(0) ""
 int(0)
-string(14) "Resource id #5"
+string(%d) "Resource id #%d"
 int(1)
 
 *** Testing str_replace() with various search values ***
@@ -908,9 +910,9 @@ array(2) {
 int(1)
 
 -- Testing Resources --
-string(14) "Resource id #6"
+string(%d) "Resource id #%d"
 int(0)
-string(14) "Resource id #7"
+string(%d) "Resource id #%d"
 int(0)
 
 -- Testing a longer and heredoc string --
@@ -954,3 +956,721 @@ NULL
 Warning: str_replace() expects at most 4 parameters, 5 given in %s on line %d
 NULL
 Done
+--UEXPECTF--
+*** Testing str_replace() on basic operations ***
+unicode(0) ""
+unicode(4) "tbst"
+unicode(0) ""
+int(0)
+unicode(1) "q"
+int(1)
+unicode(0) ""
+int(0)
+unicode(%d) "Resource id #%d"
+int(1)
+
+*** Testing str_replace() with various search values ***
+-- Iteration 0 --
+array(12) {
+  [0]=>
+  unicode(5) "FOUND"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(5) "FOUND"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(6) "-FOUND"
+  [5]=>
+  unicode(5) "FOUND"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(6) "-FOUND"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(5)
+
+-- Iteration 1 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(0)
+
+-- Iteration 2 --
+array(12) {
+  [0]=>
+  unicode(5) "FOUND"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(5) "FOUND"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(6) "-FOUND"
+  [5]=>
+  unicode(5) "FOUND"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(6) "-FOUND"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(5)
+
+-- Iteration 3 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(5) "FOUND"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(5) "FOUND"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(2)
+
+-- Iteration 4 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(5) "FOUND"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(5) "FOUND"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(2)
+
+-- Iteration 5 --
+array(12) {
+  [0]=>
+  unicode(5) "FOUND"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(5) "FOUND"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(6) "-FOUND"
+  [5]=>
+  unicode(5) "FOUND"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(6) "-FOUND"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(5)
+
+-- Iteration 6 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(5) "FOUND"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(5) "FOUND"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(2)
+
+-- Iteration 7 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(5) "FOUND"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(5) "FOUND"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(2)
+
+-- Iteration 8 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(0)
+
+-- Iteration 9 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(0)
+
+-- Iteration 10 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(5) "FOUND"
+  [11]=>
+  unicode(0) ""
+}
+int(1)
+
+-- Iteration 11 --
+array(12) {
+  [0]=>
+  unicode(1) "1"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(1) "1"
+  [3]=>
+  unicode(1) "0"
+  [4]=>
+  unicode(2) "-1"
+  [5]=>
+  unicode(1) "1"
+  [6]=>
+  unicode(1) "0"
+  [7]=>
+  unicode(2) "-1"
+  [8]=>
+  unicode(0) ""
+  [9]=>
+  array(0) {
+  }
+  [10]=>
+  unicode(3) "php"
+  [11]=>
+  unicode(0) ""
+}
+int(0)
+
+*** Testing str_replace() with various subjects ***
+--- Iteration 0 ---
+-- String after replacing the search value is => --
+unicode(177) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!FOUND 
+           ?FOUND chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '2' times
+
+--- Iteration 1 ---
+-- String after replacing the search value is => --
+unicode(177) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!FOUND 
+           ?FOUND chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '2' times
+
+--- Iteration 2 ---
+-- String after replacing the search value is => --
+unicode(182) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: FOUND 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 3 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 4 ---
+-- String after replacing the search value is => --
+unicode(182) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $FOUND: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 5 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 6 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 7 ---
+-- String after replacing the search value is => --
+unicode(189) "Hello, world,0120333.3445FOUND67          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 8 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 9 ---
+-- String after replacing the search value is => --
+unicode(193) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0FOUND \xXYZ   FOUND $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '2' times
+
+--- Iteration 10 ---
+-- String after replacing the search value is => --
+unicode(193) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xFOUND  abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 11 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 12 ---
+-- String after replacing the search value is => --
+unicode(192) "Hello, world,0120333.3445-1.234567          FOUND TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 13 ---
+-- String after replacing the search value is => --
+unicode(207) "Hello, world,FOUND12FOUND333.3445-1.234567          NULL TRUE FALSE\0
+           \0FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(FOUND).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '4' times
+
+--- Iteration 14 ---
+-- String after replacing the search value is => --
+unicode(207) "Hello, world,FOUND12FOUND333.3445-1.234567          NULL TRUE FALSE\0
+           \0FOUND«CD\0abcd \xXYZ        abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(FOUND).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '4' times
+
+--- Iteration 15 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 16 ---
+-- String after replacing the search value is => --
+unicode(307) "Hello,FOUNDworld,0120333.3445-1.234567FOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDNULLFOUNDTRUEFOUNDFALSE\0
+FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ        abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
+       FOUNDFOUNDFOUNDFOUND?Hello,FOUNDWorldFOUNDchr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '29' times
+
+--- Iteration 17 ---
+-- String after replacing the search value is => --
+unicode(203) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSEFOUND
+           FOUND0«CDFOUNDabcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '3' times
+
+--- Iteration 18 ---
+-- String after replacing the search value is => --
+unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           FOUND«CD\0abcd \xXYZ abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 19 ---
+-- String after replacing the search value is => --
+unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00FOUNDD\0abcd \xXYZ abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 20 ---
+-- String after replacing the search value is => --
+unicode(194) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           FOUND«CD\0abcd \xXYZ abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 21 ---
+-- String after replacing the search value is => --
+unicode(194) "Hello, world,0120333FOUND445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 22 ---
+-- String after replacing the search value is => --
+unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '3' times
+
+--- Iteration 23 ---
+-- String after replacing the search value is => --
+unicode(192) "Hello, world,0120333.3445-1.234567          NULL FOUND FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 24 ---
+-- String after replacing the search value is => --
+unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '3' times
+
+--- Iteration 25 ---
+-- String after replacing the search value is => --
+unicode(203) "Hello, world,0FOUND20333.3445-FOUND.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(FOUND28).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '3' times
+
+--- Iteration 26 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 27 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FOUND\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 28 ---
+-- String after replacing the search value is => --
+unicode(307) "Hello,FOUNDworld,0120333.3445-1.234567FOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDFOUNDNULLFOUNDTRUEFOUNDFALSE\0
+FOUND  FOUNDFOUNDFOUNDFOUND\00«CD\0abcdFOUND\xXYZ        abcdFOUND$$@#%^&*!~,.:;?:FOUND!!Hello,FOUNDWorldFOUND
+       FOUNDFOUNDFOUNDFOUND?Hello,FOUNDWorldFOUNDchr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '29' times
+
+--- Iteration 29 ---
+-- String after replacing the search value is => --
+unicode(186) "Hello, world,0120333.3445-1.234567FOUNDNULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '1' times
+
+--- Iteration 30 ---
+-- String after replacing the search value is => --
+unicode(199) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0aFOUNDcd \xXYZ        aFOUNDcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '2' times
+
+--- Iteration 31 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 32 ---
+-- String after replacing the search value is => --
+unicode(203) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+ FOUND    \00«CD\0abcd \xXYZFOUNDabcd $$@#%^&*!~,.:;?: !!Hello, World 
+FOUND    ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '3' times
+
+--- Iteration 33 ---
+-- String after replacing the search value is => --
+unicode(191) "Hello, world,0120333.3445-1.234567          NULL TRUE FALSE\0
+           \00«CD\0abcd \xXYZ    abcd $$@#%^&*!~,.:;?: !!Hello, World 
+           ?Hello, World chr(0).chr(128).chr(234).chr(65).chr(255).chr(256)"
+-- search string has found '0' times
+
+--- Iteration 34 ---
+-- String after replacing the search value is => --
+unicode(5) "FOUND"
+-- search string has found '1' times
+
+*** Testing Miscelleneous input data ***
+unicode(3) "qqq"
+int(5)
+array(3) {
+  [0]=>
+  unicode(3) "qqq"
+  [1]=>
+  unicode(0) ""
+  [2]=>
+  unicode(3) "ccc"
+}
+int(6)
+
+-- Testing objects --
+unicode(12) "Hello, world"
+int(1)
+
+-- Testing arrays --
+unicode(15) "multimultimulti"
+int(3)
+unicode(3) "qqq"
+int(3)
+array(2) {
+  [0]=>
+  unicode(3) "qqq"
+  [1]=>
+  unicode(3) "ccc"
+}
+int(6)
+
+Notice: Array to string conversion in %s on line %d
+array(2) {
+  [0]=>
+  unicode(15) "ArrayArrayArray"
+  [1]=>
+  unicode(3) "bbb"
+}
+int(3)
+array(2) {
+  [0]=>
+  unicode(3) "111"
+  [1]=>
+  unicode(3) "bbb"
+}
+int(3)
+array(2) {
+  [0]=>
+  unicode(4) "aaa3"
+  [1]=>
+  unicode(4) "2bbb"
+}
+int(1)
+
+-- Testing Resources --
+unicode(%d) "Resource id #%d"
+int(0)
+unicode(%d) "Resource id #%d"
+int(0)
+
+-- Testing a longer and heredoc string --
+unicode(623) "FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789
+@#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&*
+FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789"
+int(16)
+
+-- Testing a heredoc null string --
+unicode(0) ""
+int(0)
+
+-- Testing simple and complex syntax strings --
+unicode(5) "FOUND"
+unicode(5) "FOUND"
+
+Notice: Undefined variable: strS in %s on line %d
+unicode(0) ""
+unicode(5) "FOUND"
+unicode(5) "FOUND"
+
+*** Testing error conditions ***
+Warning: str_replace() expects at least 3 parameters, 0 given in %s on line %d
+NULL
+
+Warning: str_replace() expects at least 3 parameters, 1 given in %s on line %d
+NULL
+
+Warning: str_replace() expects at least 3 parameters, 1 given in %s on line %d
+NULL
+
+Warning: str_replace() expects at least 3 parameters, 2 given in %s on line %d
+NULL
+
+Warning: str_replace() expects at most 4 parameters, 5 given in %s on line %d
+NULL
+Done
index 9bd27bc95fb9bc02ed4063d7babb62f37f1fbef0..2ae50582a820a004cdf4a225c03674851b60c3c1 100644 (file)
Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ
index 5499975ed4218012fa604383dbfa0f8187b1d124..8b89fec39647537d91cd0857d44431aa88f1c3bb 100644 (file)
Binary files a/ext/standard/tests/strings/ucfirst1.phpt and b/ext/standard/tests/strings/ucfirst1.phpt differ