]> granicus.if.org Git - php/commitdiff
Fix some ereg tests for 64bit platforms.
authorRobin Fernandes <robinf@php.net>
Tue, 22 Apr 2008 15:31:56 +0000 (15:31 +0000)
committerRobin Fernandes <robinf@php.net>
Tue, 22 Apr 2008 15:31:56 +0000 (15:31 +0000)
ext/standard/tests/reg/ereg_replace_variation_002.phpt
ext/standard/tests/reg/eregi_replace_variation_002.phpt
ext/standard/tests/reg/split_variation_003.phpt
ext/standard/tests/reg/spliti_variation_003.phpt

index 3a4f3c20ed7df0eceaf45bf307df9b9641974ba4..bd55dbcde424c046717772df9e7081b5533cfa86 100644 (file)
@@ -103,7 +103,7 @@ Arg value -10.5
 string(8) "h%F6o%21"
 
 Arg value 101234567000 
-string(6) "hXo%21"
+string(%d) "h%so%21"
 
 Arg value 1.07654321E-9 
 string(5) "ho%21"
index 3c52d07c1c91b3c3a233aeaa9e5e94628cafd5cd..786de9978aec7c23ff975452370543ab2dcb2f05 100644 (file)
@@ -103,7 +103,7 @@ Arg value -10.5
 string(8) "h%F6o%21"
 
 Arg value 101234567000 
-string(6) "hXo%21"
+string(%d) "h%so%21"
 
 Arg value 1.07654321E-9 
 string(5) "ho%21"
index 65b7fa02f22b7c80434026d31f6fabc607d037c3..7686c088680a7239a6ef36d2befda9251271a615 100644 (file)
@@ -9,7 +9,10 @@ Test split() function : usage variations  - unexpected type for arg 3
  */
 
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+       if (error_reporting() != 0) {
+               // report non-silenced errors
+               echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+       }
 }
 set_error_handler('test_error_handler');
 echo "*** Testing split() : usage variations ***\n";
@@ -28,7 +31,6 @@ $values = array(
       // float data
       10.5,
       -10.5,
-      10.1234567e10,
       10.7654321E-10,
       .5,
 
@@ -61,10 +63,10 @@ $values = array(
       new stdclass(),
 
       // undefined data
-      $undefined_var,
+      @$undefined_var,
 
       // unset data
-      $unset_var,
+      @$unset_var,
 );
 
 // loop through each element of the array for limit
@@ -78,8 +80,6 @@ echo "Done";
 ?>
 --EXPECTF--
 *** Testing split() : usage variations ***
-Error: 8 - Undefined variable: undefined_var, %s(61)
-Error: 8 - Undefined variable: unset_var, %s(64)
 
 Arg value 10.5 
 array(5) {
@@ -101,12 +101,6 @@ array(1) {
   string(9) "1 2 3 4 5"
 }
 
-Arg value 101234567000 
-array(1) {
-  [0]=>
-  string(9) "1 2 3 4 5"
-}
-
 Arg value 1.07654321E-9 
 array(1) {
   [0]=>
@@ -208,10 +202,10 @@ array(1) {
   [0]=>
   string(9) "1 2 3 4 5"
 }
-Error: 4096 - Object of class stdClass could not be converted to string, %s(70)
+Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
 
 Arg value  
-Error: 8 - Object of class stdClass could not be converted to int, %s(71)
+Error: 8 - Object of class stdClass could not be converted to int, %s(73)
 array(1) {
   [0]=>
   string(9) "1 2 3 4 5"
index 4a2a689f5a5dcb058596b1179e413af6725694fe..e6c8f10b508da1b8fe0d367d109f69dfe61ad2b7 100644 (file)
@@ -9,7 +9,10 @@ Test spliti() function : usage variations  - unexpected type for arg 3
  */
 
 function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
-       echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+       if (error_reporting() != 0) {
+               // report non-silenced errors
+               echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+       }
 }
 set_error_handler('test_error_handler');
 echo "*** Testing spliti() : usage variations ***\n";
@@ -28,7 +31,6 @@ $values = array(
       // float data
       10.5,
       -10.5,
-      10.1234567e10,
       10.7654321E-10,
       .5,
 
@@ -61,10 +63,10 @@ $values = array(
       new stdclass(),
 
       // undefined data
-      $undefined_var,
+      @$undefined_var,
 
       // unset data
-      $unset_var,
+      @$unset_var,
 );
 
 // loop through each element of the array for limit
@@ -78,8 +80,6 @@ echo "Done";
 ?>
 --EXPECTF--
 *** Testing spliti() : usage variations ***
-Error: 8 - Undefined variable: undefined_var, %s(61)
-Error: 8 - Undefined variable: unset_var, %s(64)
 
 Arg value 10.5 
 array(5) {
@@ -101,12 +101,6 @@ array(1) {
   string(9) "1 2 3 4 5"
 }
 
-Arg value 101234567000 
-array(1) {
-  [0]=>
-  string(9) "1 2 3 4 5"
-}
-
 Arg value 1.07654321E-9 
 array(1) {
   [0]=>
@@ -208,10 +202,10 @@ array(1) {
   [0]=>
   string(9) "1 2 3 4 5"
 }
-Error: 4096 - Object of class stdClass could not be converted to string, %s(70)
+Error: 4096 - Object of class stdClass could not be converted to string, %s(72)
 
 Arg value  
-Error: 8 - Object of class stdClass could not be converted to int, %s(71)
+Error: 8 - Object of class stdClass could not be converted to int, %s(73)
 array(1) {
   [0]=>
   string(9) "1 2 3 4 5"