summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-12-25 13:18:45 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-12-26 12:39:06 +0100
commitb2b2b437af5495dcb2016be6e45567ed826cb87e (patch)
tree7cf17c011f6b9c272eebf184fa47d5c35f455b2f /Zend/tests
parentefcbea43455ca4e27ec6fc5ce2f3a740a981247e (diff)
downloadphp-git-b2b2b437af5495dcb2016be6e45567ed826cb87e.tar.gz
Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an _IS_NUMBER argument, in which case the cast handler should return either an integer or floating point number, whichever is more appropriate. Previously convert_scalar_to_number() unconditionally converted objects to integers instead. Fixes bug #53033. Fixes bug #54973. Fixes bug #73108.
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/add_002.phpt4
-rw-r--r--Zend/tests/add_003.phpt4
-rw-r--r--Zend/tests/assert/indirect_var_access_misoptimization.phpt2
-rw-r--r--Zend/tests/bug73337.phpt4
4 files changed, 7 insertions, 7 deletions
diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt
index 4d804fe3e8..1e9148ffa5 100644
--- a/Zend/tests/add_002.phpt
+++ b/Zend/tests/add_002.phpt
@@ -20,11 +20,11 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Notice: Object of class stdClass could not be converted to int in %sadd_002.php on line %d
+Notice: Object of class stdClass could not be converted to number in %sadd_002.php on line %d
Exception: Unsupported operand types
-Notice: Object of class stdClass could not be converted to int in %s on line %d
+Notice: Object of class stdClass could not be converted to number in %s on line %d
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
Stack trace:
diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt
index a3705479e2..cc2a0dd1a7 100644
--- a/Zend/tests/add_003.phpt
+++ b/Zend/tests/add_003.phpt
@@ -20,11 +20,11 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
-Notice: Object of class stdClass could not be converted to int in %sadd_003.php on line %d
+Notice: Object of class stdClass could not be converted to number in %sadd_003.php on line %d
Exception: Unsupported operand types
-Notice: Object of class stdClass could not be converted to int in %s on line %d
+Notice: Object of class stdClass could not be converted to number in %s on line %d
Fatal error: Uncaught Error: Unsupported operand types in %s:%d
Stack trace:
diff --git a/Zend/tests/assert/indirect_var_access_misoptimization.phpt b/Zend/tests/assert/indirect_var_access_misoptimization.phpt
index 6c05a8c607..02327f30c0 100644
--- a/Zend/tests/assert/indirect_var_access_misoptimization.phpt
+++ b/Zend/tests/assert/indirect_var_access_misoptimization.phpt
@@ -17,5 +17,5 @@ test();
--EXPECTF--
Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d
-Notice: Object of class stdClass could not be converted to int in %s on line %d
+Notice: Object of class stdClass could not be converted to number in %s on line %d
int(2)
diff --git a/Zend/tests/bug73337.phpt b/Zend/tests/bug73337.phpt
index 9eff18e643..53ce963c52 100644
--- a/Zend/tests/bug73337.phpt
+++ b/Zend/tests/bug73337.phpt
@@ -6,7 +6,7 @@ class d { function __destruct() { throw new Exception; } }
try { new d + new d; } catch (Exception $e) { print "Exception properly caught\n"; }
?>
--EXPECTF--
-Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
+Notice: Object of class d could not be converted to number in %sbug73337.php on line 3
-Notice: Object of class d could not be converted to int in %sbug73337.php on line 3
+Notice: Object of class d could not be converted to number in %sbug73337.php on line 3
Exception properly caught