summaryrefslogtreecommitdiff
path: root/ext/ereg
diff options
context:
space:
mode:
authorRobin Fernandes <robinf@php.net>2008-04-22 15:31:57 +0000
committerRobin Fernandes <robinf@php.net>2008-04-22 15:31:57 +0000
commit5cb8dd80401432e023babda95e0994c07726b937 (patch)
tree56c39fe3257d9de2c0adee3eedf58c35c1d9f333 /ext/ereg
parent823b31d30cb74b50b980222e237199aa3607caa0 (diff)
downloadphp-git-5cb8dd80401432e023babda95e0994c07726b937.tar.gz
Fix some ereg tests for 64bit platforms.
Diffstat (limited to 'ext/ereg')
-rw-r--r--ext/ereg/tests/ereg_replace_variation_002.phpt4
-rw-r--r--ext/ereg/tests/eregi_replace_variation_002.phpt4
-rw-r--r--ext/ereg/tests/split_variation_003.phpt32
-rw-r--r--ext/ereg/tests/spliti_variation_003.phpt32
4 files changed, 22 insertions, 50 deletions
diff --git a/ext/ereg/tests/ereg_replace_variation_002.phpt b/ext/ereg/tests/ereg_replace_variation_002.phpt
index 16a4d5614b..1032060f71 100644
--- a/ext/ereg/tests/ereg_replace_variation_002.phpt
+++ b/ext/ereg/tests/ereg_replace_variation_002.phpt
@@ -16,7 +16,7 @@ set_error_handler('test_error_handler');
echo "*** Testing ereg_replace() : usage variations ***\n";
// Initialise function arguments not being substituted (if any)
-$pattern = 'ell';
+$pattern = b'ell';
$string = 'hello!';
//get an unset variable
@@ -103,7 +103,7 @@ Arg value -10.5
string(8) "h%F6o%21"
Arg value 101234567000
-string(8) "h%FFo%21"
+string(%d) "h%so%21"
Arg value 1.07654321E-9
string(5) "ho%21"
diff --git a/ext/ereg/tests/eregi_replace_variation_002.phpt b/ext/ereg/tests/eregi_replace_variation_002.phpt
index ed4fb4cd4b..4186d0fd3d 100644
--- a/ext/ereg/tests/eregi_replace_variation_002.phpt
+++ b/ext/ereg/tests/eregi_replace_variation_002.phpt
@@ -16,7 +16,7 @@ set_error_handler('test_error_handler');
echo "*** Testing eregi_replace() : usage variations ***\n";
// Initialise function arguments not being substituted (if any)
-$pattern = 'ell';
+$pattern = b'ell';
$string = 'hello!';
//get an unset variable
@@ -103,7 +103,7 @@ Arg value -10.5
string(8) "h%F6o%21"
Arg value 101234567000
-string(8) "h%FFo%21"
+string(%d) "h%so%21"
Arg value 1.07654321E-9
string(5) "ho%21"
diff --git a/ext/ereg/tests/split_variation_003.phpt b/ext/ereg/tests/split_variation_003.phpt
index ce7c778fe3..9f13c66fd6 100644
--- a/ext/ereg/tests/split_variation_003.phpt
+++ b/ext/ereg/tests/split_variation_003.phpt
@@ -9,13 +9,16 @@ 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";
// Initialise function arguments not being substituted (if any)
-$pattern = '[[:space:]]';
+$pattern = b'[[:space:]]';
$string = '1 2 3 4 5';
//get an unset variable
@@ -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,20 +101,6 @@ array(1) {
string(9) "1 2 3 4 5"
}
-Arg value 101234567000
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "2"
- [2]=>
- string(1) "3"
- [3]=>
- string(1) "4"
- [4]=>
- string(1) "5"
-}
-
Arg value 1.07654321E-9
array(1) {
[0]=>
@@ -216,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"
diff --git a/ext/ereg/tests/spliti_variation_003.phpt b/ext/ereg/tests/spliti_variation_003.phpt
index 7e3d80f885..3566a92be0 100644
--- a/ext/ereg/tests/spliti_variation_003.phpt
+++ b/ext/ereg/tests/spliti_variation_003.phpt
@@ -9,13 +9,16 @@ 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";
// Initialise function arguments not being substituted (if any)
-$pattern = '[[:space:]]';
+$pattern = b'[[:space:]]';
$string = '1 2 3 4 5';
//get an unset variable
@@ -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,20 +101,6 @@ array(1) {
string(9) "1 2 3 4 5"
}
-Arg value 101234567000
-array(5) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "2"
- [2]=>
- string(1) "3"
- [3]=>
- string(1) "4"
- [4]=>
- string(1) "5"
-}
-
Arg value 1.07654321E-9
array(1) {
[0]=>
@@ -216,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"