diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-25 13:18:45 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-12-26 12:39:06 +0100 |
commit | b2b2b437af5495dcb2016be6e45567ed826cb87e (patch) | |
tree | 7cf17c011f6b9c272eebf184fa47d5c35f455b2f /ext/standard/tests/math | |
parent | efcbea43455ca4e27ec6fc5ce2f3a740a981247e (diff) | |
download | php-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 'ext/standard/tests/math')
-rw-r--r-- | ext/standard/tests/math/abs_variation.phpt | 4 | ||||
-rw-r--r-- | ext/standard/tests/math/ceil_variation1.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/math/floor_variation1.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/math/pow_variation1.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/math/pow_variation1_64bit.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/math/pow_variation2.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/math/round_variation1.phpt | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index 6df1e6b55c..ed9085446b 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -121,7 +121,7 @@ int(0) -- Iteration 13 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d int(1) -- Iteration 14 -- @@ -132,4 +132,4 @@ int(0) -- Iteration 16 -- int(%d) -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index 7c1f859277..35a9e1d4a3 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -114,7 +114,7 @@ float(0) -- Iteration 13 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d float(1) -- Iteration 14 -- diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index baba53aab4..fcb895164a 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -114,7 +114,7 @@ float(0) -- Iteration 13 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d float(1) -- Iteration 14 -- diff --git a/ext/standard/tests/math/pow_variation1.phpt b/ext/standard/tests/math/pow_variation1.phpt index c744c4eb9d..3b1befe16b 100644 --- a/ext/standard/tests/math/pow_variation1.phpt +++ b/ext/standard/tests/math/pow_variation1.phpt @@ -172,7 +172,7 @@ int(0) -- Iteration 23 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d int(1) -- Iteration 24 -- diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt index ea2ae45d18..35f9942490 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -172,7 +172,7 @@ int(0) -- Iteration 23 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d int(1) -- Iteration 24 -- diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt index 36b085b647..d93a952dbe 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -168,7 +168,7 @@ float(1) -- Iteration 23 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d float(20.3) -- Iteration 24 -- diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index c89dd6818a..c1883a5c1b 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -159,7 +159,7 @@ float(0) -- Iteration 23 -- -Notice: Object of class classA could not be converted to int in %s on line %d +Notice: Object of class classA could not be converted to number in %s on line %d float(1) -- Iteration 24 -- |