]> granicus.if.org Git - php/commitdiff
Fixed bug #42868 (Floats cast to integer produce unpredicatable results). (Zoe Slattery)
authorDmitry Stogov <dmitry@php.net>
Mon, 17 Dec 2007 10:02:13 +0000 (10:02 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 17 Dec 2007 10:02:13 +0000 (10:02 +0000)
15 files changed:
NEWS
Zend/zend_operators.c
ext/standard/tests/array/array_fill_variation1.phpt
ext/standard/tests/general_functions/gettype_settype_variation2.phpt
ext/standard/tests/strings/chunk_split_variation2.phpt
ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt
ext/standard/tests/strings/pack.phpt
ext/standard/tests/strings/sprintf_variation35.phpt
ext/standard/tests/strings/sprintf_variation4.phpt
ext/standard/tests/strings/sprintf_variation41.phpt
ext/standard/tests/strings/str_split_variation2.phpt
ext/standard/tests/strings/vsprintf_variation15.phpt
ext/standard/tests/strings/vsprintf_variation15_64bit.phpt
ext/standard/tests/strings/vsprintf_variation16.phpt
ext/standard/tests/strings/vsprintf_variation4.phpt

diff --git a/NEWS b/NEWS
index 2770bfd459e6776f1c435a2f91cf02285f224f7e..9706a29393d6b03bbb439b07faa573b729ce59a3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -68,6 +68,8 @@ PHP                                                                        NEWS
 - Fixed bug #43128 (Very long class name causes segfault). (Dmitry)
 - Fixed bug #42952 (soap cache file is created with insecure permissions).
   (Dmitry)
+- Fixed bug #42868 (Floats cast to integer produce unpredicatable results).
+  (Zoe Slattery)
 - Fixed bug #42848 (Status: header incorrect under FastCGI). (Dmitry)
 - Fixed bug #42773 (WSDL error causes HTTP 500 Response). (Dmitry)
 - Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines). (Nuno)
index 0805ec71674f57679defef048b4d91877e9252a3..c177c3ec8f6e6219e2fa48b1c0c74c52254e5e4b 100644 (file)
@@ -183,20 +183,37 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
                }                                                                                                                                       \
        }
 
+#define MAX_UNSIGNED_INT ((double) LONG_MAX * 2) + 1
 #ifdef _WIN64
 # define DVAL_TO_LVAL(d, l) \
-       if ((d) > LONG_MAX) { \
-               (l) = (long)(unsigned long)(__int64) (d); \
-       } else { \
-               (l) = (long) (d); \
-       }
+        if ((d) > LONG_MAX) { \
+                if ((d) > MAX_UNSIGNED_INT) { \
+                        (l) = LONG_MAX; \
+                } else { \
+                        (l) = (long)(unsigned long)(__int64) (d); \
+                } \
+        } else { \
+                if((d) < LONG_MIN) { \
+                        (l) = LONG_MIN; \
+                } else { \
+                        (l) = (long) (d); \
+                } \
+        }
 #else
 # define DVAL_TO_LVAL(d, l) \
-       if ((d) > LONG_MAX) { \
-               (l) = (unsigned long) (d); \
-       } else { \
-               (l) = (long) (d); \
-       }
+        if ((d) > LONG_MAX) { \
+                if ((d) > MAX_UNSIGNED_INT) { \
+                        (l) = LONG_MAX; \
+                } else { \
+                        (l) = (unsigned long) (d); \
+                } \
+        } else { \
+                if((d) < LONG_MIN) { \
+                        (l) = LONG_MIN; \
+                } else { \
+                        (l) = (long) (d); \
+                } \
+        }
 #endif
 
 #define zendi_convert_to_long(op, holder, result)                                      \
index 754847fc83cfedc58dbf593ea2e22fdef87020bf..b5b70a3ef41718c56845488be0f782394333a196 100644 (file)
@@ -125,9 +125,9 @@ array(2) {
 }
 -- Iteration 3 --
 array(2) {
-  [-1097262584]=>
+  [2147483647]=>
   int(100)
-  [0]=>
+  [-2147483648]=>
   int(100)
 }
 -- Iteration 4 --
@@ -146,23 +146,23 @@ array(2) {
 }
 -- Iteration 6 --
 
-Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 7 --
 
-Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 8 --
 
-Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 9 --
 
-Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 10 --
 
-Warning: array_fill() expects parameter 1 to be long, array given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 11 --
 array(2) {
@@ -208,23 +208,23 @@ array(2) {
 }
 -- Iteration 17 --
 
-Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 18 --
 
-Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 19 --
 
-Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 20 --
 
-Warning: array_fill() expects parameter 1 to be long, string given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 21 --
 
-Warning: array_fill() expects parameter 1 to be long, object given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, object given in %sarray_fill_variation1.php on line %d
 NULL
 -- Iteration 22 --
 array(2) {
@@ -242,6 +242,6 @@ array(2) {
 }
 -- Iteration 24 --
 
-Warning: array_fill() expects parameter 1 to be long, resource given in %s on line %d
+Warning: array_fill() expects parameter 1 to be long, resource given in %sarray_fill_variation1.php on line %d
 NULL
 Done
index 8d14fd72c6674eb4e6b3ff7e5c465e1ca06fe63c..a4423a697f8e50b79348f6d2d48706ce85ef7924 100644 (file)
@@ -187,7 +187,7 @@ foreach ($types as $type) {
 
 echo "Done\n";
 ?>
---EXPECTF--    
+--EXPECTF--
 8: Undefined variable: unset_var
 8: Undefined variable: undef_var
 
@@ -447,7 +447,7 @@ string(7) "integer"
 -- Iteration 51 --
 string(6) "double"
 bool(true)
-int(-508130303)
+int(2147483647)
 string(7) "integer"
 -- Iteration 52 --
 string(7) "integer"
@@ -457,7 +457,7 @@ string(7) "integer"
 -- Iteration 53 --
 string(6) "double"
 bool(true)
-int(1952002105)
+int(2147483647)
 string(7) "integer"
 -- Iteration 54 --
 string(7) "integer"
@@ -477,7 +477,7 @@ string(7) "integer"
 -- Iteration 57 --
 string(6) "double"
 bool(true)
-int(343000682)
+int(2147483647)
 string(7) "integer"
 -- Iteration 58 --
 string(6) "double"
@@ -852,7 +852,7 @@ string(7) "integer"
 -- Iteration 51 --
 string(6) "double"
 bool(true)
-int(-508130303)
+int(2147483647)
 string(7) "integer"
 -- Iteration 52 --
 string(7) "integer"
@@ -862,7 +862,7 @@ string(7) "integer"
 -- Iteration 53 --
 string(6) "double"
 bool(true)
-int(1952002105)
+int(2147483647)
 string(7) "integer"
 -- Iteration 54 --
 string(7) "integer"
@@ -882,7 +882,7 @@ string(7) "integer"
 -- Iteration 57 --
 string(6) "double"
 bool(true)
-int(343000682)
+int(2147483647)
 string(7) "integer"
 -- Iteration 58 --
 string(6) "double"
index 924e6e21ff83564c36d71fb55838215553bfa5f7..3a038950a805828a1128e9c492048b5f2b37ac9f 100644 (file)
@@ -95,23 +95,21 @@ fclose($fp);
 string(28) "This is ch*uklen vari*ation*"
 -- Iteration 2 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 3 --
-
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
-bool(false)
+string(26) "This is chuklen variation*"
 -- Iteration 4 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 5 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 6 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 7 --
 string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
@@ -123,52 +121,52 @@ string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
 string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
 -- Iteration 11 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 12 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 13 --
 string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
 -- Iteration 14 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 15 --
 string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
 -- Iteration 16 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 17 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 18 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 19 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 20 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 21 --
 
-Notice: Object of class MyClass could not be converted to int in %s on line %d
+Notice: Object of class MyClass could not be converted to int in %schunk_split_variation2.php on line %d
 string(50) "T*h*i*s* *i*s* *c*h*u*k*l*e*n* *v*a*r*i*a*t*i*o*n*"
 -- Iteration 22 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 23 --
 
-Warning: chunk_split(): Chunk length should be greater than zero in %s on line %d
+Warning: chunk_split(): Chunk length should be greater than zero in %schunk_split_variation2.php on line %d
 bool(false)
 -- Iteration 24 --
-string(%d) "%s"
-Done
\ No newline at end of file
+string(30) "This *is ch*uklen* vari*ation*"
+Done
index 2ef7dd1bb8fd3701a7d65f6431b2b6b4484e8038..9ac06218960170b3da7b3906760201a4f8f43246 100644 (file)
@@ -102,7 +102,7 @@ string(104) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 =
 string(104) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
 
 -- Iteration 3 --
-string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. &quot; double quote string &quot;</html>"
+string(94) "<html>Roy's height > Sam's height. 13 < 15. 1111 & 0000 = 0000. " double quote string "</html>"
 
 -- Iteration 4 --
 string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 = 0000. &quot; double quote string &quot;</html>"
@@ -112,27 +112,27 @@ string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 =
 
 -- Iteration 6 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 7 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 8 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 9 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 10 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, array given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 11 --
@@ -155,27 +155,27 @@ string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 =
 
 -- Iteration 17 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 18 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 19 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 20 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, string given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 21 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, object given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, object given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 
 -- Iteration 22 --
@@ -186,6 +186,6 @@ string(114) "<html>Roy&#039;s height > Sam&#039;s height. 13 < 15. 1111 & 0000 =
 
 -- Iteration 24 --
 
-Warning: htmlspecialchars_decode() expects parameter 2 to be long, resource given in %s on line %d
+Warning: htmlspecialchars_decode() expects parameter 2 to be long, resource given in %shtmlspecialchars_decode_variation2.php on line %d
 NULL
 Done
index f64c24c96b9647e7f93e05e7c27842ebe340e5cf..0c340478e30d2fd24e1e66a295be7d7faf14c040 100644 (file)
@@ -145,7 +145,7 @@ Array
 )
 Array
 (
-    [1] => 0
+    [1] => 2147483647
 )
 Array
 (
@@ -185,7 +185,7 @@ Array
 )
 Array
 (
-    [1] => 0
+    [1] => 2147483647
 )
 Array
 (
@@ -233,7 +233,7 @@ Array
 )
 Array
 (
-    [1] => 0
+    [1] => 2147483647
 )
 Array
 (
@@ -305,7 +305,7 @@ Array
 )
 Array
 (
-    [1] => 0
+    [1] => 2147483647
 )
 Array
 (
index ca6ba891dd12f9a9eeb6f31bd0e4fd77c359c282..6f80dca3faf68c69a7fc9ddde8c171e6a33318d0 100644 (file)
@@ -71,17 +71,17 @@ string(10) "0-9A-Fa-f]"
 string(1) "x"
 
 -- Iteration 2 --
-string(1) "1"
-string(2) "1x"
-string(1) "1"
+string(8) "7fffffff"
+string(9) "7fffffffx"
+string(8) "7fffffff"
 string(1) "x"
-string(2) " 1"
-string(2) "1 "
-string(2) "    1"
-string(2) "
-1"
-string(4) "   1"
-string(30) "                             1"
+string(9) " 7fffffff"
+string(9) "7fffffff "
+string(9) "    7fffffff"
+string(9) "
+7fffffff"
+string(8) "7fffffff"
+string(30) "                      7fffffff"
 string(10) "0-9A-Fa-f]"
 string(1) "x"
 
index 7fc66f910ed93df62330072928eaa15781fb9c4e..e0f8173acf433aad8e2ca049afbc7fae97994cc4 100644 (file)
@@ -71,17 +71,17 @@ string(4) "0-9]"
 string(1) "d"
 
 -- Iteration 2 --
-string(1) "1"
+string(10) "2147483647"
 string(1) "d"
-string(1) "1"
+string(10) "2147483647"
 string(1) "d"
-string(2) " 1"
-string(2) "1 "
-string(2) "    1"
-string(2) "
-1"
-string(4) "   1"
-string(30) "                             1"
+string(11) " 2147483647"
+string(11) "2147483647 "
+string(11) "   2147483647"
+string(11) "
+2147483647"
+string(10) "2147483647"
+string(30) "                    2147483647"
 string(4) "0-9]"
 string(1) "d"
 
index 219ea0f025afc22b3a4b0fd67098669ffabce9e8..f3a65a3bb82ea992f73a95ae21b1bdd355c5d4a7 100644 (file)
@@ -75,17 +75,17 @@ string(4) "0-9]"
 string(1) "u"
 
 -- Iteration 2 --
-string(1) "1"
+string(10) "2147483647"
 string(1) "u"
-string(1) "1"
+string(10) "2147483647"
 string(1) "u"
-string(2) " 1"
-string(2) "1 "
-string(2) "    1"
-string(2) "
-1"
-string(4) "   1"
-string(30) "                             1"
+string(11) " 2147483647"
+string(11) "2147483647 "
+string(11) "   2147483647"
+string(11) "
+2147483647"
+string(10) "2147483647"
+string(30) "                    2147483647"
 string(4) "0-9]"
 string(1) "u"
 
index 376ee3b6d55c6a3b01e95de60e8003ec20ebb6e8..e11c3f0e79ab99815dbe4badcbacf39976e9a2c5 100644 (file)
@@ -107,47 +107,48 @@ array(3) {
 }
 --Iteration 2 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 3 --
-
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
-bool(false)
+array(1) {
+  [0]=>
+  string(23) "variation2:split_length"
+}
 --Iteration 4 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 5 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 6 --
 
-Warning: str_split() expects parameter 2 to be long, array given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, array given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 7 --
 
-Warning: str_split() expects parameter 2 to be long, array given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, array given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 8 --
 
-Warning: str_split() expects parameter 2 to be long, array given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, array given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 9 --
 
-Warning: str_split() expects parameter 2 to be long, array given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, array given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 10 --
 
-Warning: str_split() expects parameter 2 to be long, array given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, array given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 11 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 12 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 13 --
 array(23) {
@@ -200,7 +201,7 @@ array(23) {
 }
 --Iteration 14 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 15 --
 array(23) {
@@ -253,38 +254,38 @@ array(23) {
 }
 --Iteration 16 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 17 --
 
-Warning: str_split() expects parameter 2 to be long, string given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, string given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 18 --
 
-Warning: str_split() expects parameter 2 to be long, string given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, string given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 19 --
 
-Warning: str_split() expects parameter 2 to be long, string given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, string given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 20 --
 
-Warning: str_split() expects parameter 2 to be long, string given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, string given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 21 --
 
-Warning: str_split() expects parameter 2 to be long, object given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, object given in %sstr_split_variation2.php on line %d
 NULL
 --Iteration 22 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 23 --
 
-Warning: str_split(): The length of each segment must be greater than zero in %s on line %d
+Warning: str_split(): The length of each segment must be greater than zero in %sstr_split_variation2.php on line %d
 bool(false)
 --Iteration 24 --
 
-Warning: str_split() expects parameter 2 to be long, resource given in %s on line %d
+Warning: str_split() expects parameter 2 to be long, resource given in %sstr_split_variation2.php on line %d
 NULL
 Done
index cedfe3f0efe1de7cccab5e6d13c5c70c27aa8828..523e34ecd1752860adc8c7ef07c56695a812131d 100644 (file)
@@ -55,10 +55,10 @@ echo "Done";
 string(16) "1234567 342391 0"
 
 -- Iteration 2 --
-string(23) "3755744308 u 1234 12345"
+string(23) "2147483647 u 1234 12345"
 
 -- Iteration 3 --
-string(25) "   1234000 0          120"
+string(25) "   1234000 2147483647 120"
 
 -- Iteration 4 --
 string(10) "#1 0 $0 10"
index 3af1738e564d89d0ca155804a9e9d18937da0a71..8cc4316320fca1f6bc3f5ac4969ca094126abd85 100644 (file)
@@ -58,7 +58,7 @@ string(16) "1234567 342391 0"
 string(24) "12345678900 u 1234 12345"
 
 -- Iteration 3 --
-string(25) "   1234000 0          120"
+string(34) "   1234000 9223372036854775807 120"
 
 -- Iteration 4 --
 string(10) "#1 0 $0 10"
index 01bcc662d504f9340e8e01060af9be5d165c0f08..8434aa5371e0cad61a9cd9f6aea7c45b6797d7c7 100644 (file)
@@ -76,8 +76,8 @@ echo "Done";
 
 -- Iteration 1 --
 string(115) "2 0 10 
-   123456 u 1234 2820130816
-   2840207360 1177509888 12345 
+   123456 u 1234 2147483647
+   2147483647 2147483647 12345 
    12 4294967284 4294843840 _3
    10 123456 2 0"
 
index e3e6737b826791cf9e250ef7aa817de0f15a0e18..e72b8e898cca1989e8bed16724f00b8a63e9e866 100644 (file)
@@ -75,9 +75,9 @@ echo "Done";
 *** Testing vsprintf() : int formats and non-integer values ***
 
 -- Iteration 1 --
-string(112) "2 +0 10 
+string(111) "2 +0 10 
    123456 d -1234 1234
-   -1474836480 200000     4000 22000000
+   2147483647 200000     4000 22000000
    12345 12 -12 -123456
    10 123456 2 0"