mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
161 lines
5.0 KiB
PHP
161 lines
5.0 KiB
PHP
--TEST--
|
|
Test atan2() - basic function test of atan2()
|
|
--INI--
|
|
serialize_precision=14
|
|
--FILE--
|
|
<?php
|
|
$valuesy = array(23,
|
|
-23,
|
|
2.345e1,
|
|
-2.345e1,
|
|
0x17,
|
|
027,
|
|
"23",
|
|
"23.45",
|
|
"2.345e1",
|
|
true,
|
|
false);
|
|
|
|
$valuesx = array(23,
|
|
-23,
|
|
2.345e1,
|
|
-2.345e1,
|
|
0x17,
|
|
027,
|
|
"23",
|
|
"23.45",
|
|
"2.345e1",
|
|
true,
|
|
false);
|
|
|
|
for ($i = 0; $i < count($valuesy); $i++) {
|
|
for ($j = 0; $j < count($valuesx); $j++) {
|
|
$res = atan2($valuesy[$i], $valuesx[$j]);
|
|
echo "Y:$valuesy[$i] X:$valuesx[$j] ";
|
|
var_dump($res);
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:-23 float(2.3561944901923)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:-23.45 float(2.3658820235113)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:2.345e1 float(0.77571063007847)
|
|
Y:23 X:1 float(1.5273454314034)
|
|
Y:23 X: float(1.5707963267949)
|
|
Y:-23 X:23 float(-0.78539816339745)
|
|
Y:-23 X:-23 float(-2.3561944901923)
|
|
Y:-23 X:23.45 float(-0.77571063007847)
|
|
Y:-23 X:-23.45 float(-2.3658820235113)
|
|
Y:-23 X:23 float(-0.78539816339745)
|
|
Y:-23 X:23 float(-0.78539816339745)
|
|
Y:-23 X:23 float(-0.78539816339745)
|
|
Y:-23 X:23.45 float(-0.77571063007847)
|
|
Y:-23 X:2.345e1 float(-0.77571063007847)
|
|
Y:-23 X:1 float(-1.5273454314034)
|
|
Y:-23 X: float(-1.5707963267949)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:-23 float(2.3465069568734)
|
|
Y:23.45 X:23.45 float(0.78539816339745)
|
|
Y:23.45 X:-23.45 float(2.3561944901923)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23.45 float(0.78539816339745)
|
|
Y:23.45 X:2.345e1 float(0.78539816339745)
|
|
Y:23.45 X:1 float(1.5281782247706)
|
|
Y:23.45 X: float(1.5707963267949)
|
|
Y:-23.45 X:23 float(-0.79508569671643)
|
|
Y:-23.45 X:-23 float(-2.3465069568734)
|
|
Y:-23.45 X:23.45 float(-0.78539816339745)
|
|
Y:-23.45 X:-23.45 float(-2.3561944901923)
|
|
Y:-23.45 X:23 float(-0.79508569671643)
|
|
Y:-23.45 X:23 float(-0.79508569671643)
|
|
Y:-23.45 X:23 float(-0.79508569671643)
|
|
Y:-23.45 X:23.45 float(-0.78539816339745)
|
|
Y:-23.45 X:2.345e1 float(-0.78539816339745)
|
|
Y:-23.45 X:1 float(-1.5281782247706)
|
|
Y:-23.45 X: float(-1.5707963267949)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:-23 float(2.3561944901923)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:-23.45 float(2.3658820235113)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:2.345e1 float(0.77571063007847)
|
|
Y:23 X:1 float(1.5273454314034)
|
|
Y:23 X: float(1.5707963267949)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:-23 float(2.3561944901923)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:-23.45 float(2.3658820235113)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:2.345e1 float(0.77571063007847)
|
|
Y:23 X:1 float(1.5273454314034)
|
|
Y:23 X: float(1.5707963267949)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:-23 float(2.3561944901923)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:-23.45 float(2.3658820235113)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23 float(0.78539816339745)
|
|
Y:23 X:23.45 float(0.77571063007847)
|
|
Y:23 X:2.345e1 float(0.77571063007847)
|
|
Y:23 X:1 float(1.5273454314034)
|
|
Y:23 X: float(1.5707963267949)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:-23 float(2.3465069568734)
|
|
Y:23.45 X:23.45 float(0.78539816339745)
|
|
Y:23.45 X:-23.45 float(2.3561944901923)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23 float(0.79508569671643)
|
|
Y:23.45 X:23.45 float(0.78539816339745)
|
|
Y:23.45 X:2.345e1 float(0.78539816339745)
|
|
Y:23.45 X:1 float(1.5281782247706)
|
|
Y:23.45 X: float(1.5707963267949)
|
|
Y:2.345e1 X:23 float(0.79508569671643)
|
|
Y:2.345e1 X:-23 float(2.3465069568734)
|
|
Y:2.345e1 X:23.45 float(0.78539816339745)
|
|
Y:2.345e1 X:-23.45 float(2.3561944901923)
|
|
Y:2.345e1 X:23 float(0.79508569671643)
|
|
Y:2.345e1 X:23 float(0.79508569671643)
|
|
Y:2.345e1 X:23 float(0.79508569671643)
|
|
Y:2.345e1 X:23.45 float(0.78539816339745)
|
|
Y:2.345e1 X:2.345e1 float(0.78539816339745)
|
|
Y:2.345e1 X:1 float(1.5281782247706)
|
|
Y:2.345e1 X: float(1.5707963267949)
|
|
Y:1 X:23 float(0.043450895391531)
|
|
Y:1 X:-23 float(3.0981417581983)
|
|
Y:1 X:23.45 float(0.042618102024328)
|
|
Y:1 X:-23.45 float(3.0989745515655)
|
|
Y:1 X:23 float(0.043450895391531)
|
|
Y:1 X:23 float(0.043450895391531)
|
|
Y:1 X:23 float(0.043450895391531)
|
|
Y:1 X:23.45 float(0.042618102024328)
|
|
Y:1 X:2.345e1 float(0.042618102024328)
|
|
Y:1 X:1 float(0.78539816339745)
|
|
Y:1 X: float(1.5707963267949)
|
|
Y: X:23 float(0)
|
|
Y: X:-23 float(3.1415926535898)
|
|
Y: X:23.45 float(0)
|
|
Y: X:-23.45 float(3.1415926535898)
|
|
Y: X:23 float(0)
|
|
Y: X:23 float(0)
|
|
Y: X:23 float(0)
|
|
Y: X:23.45 float(0)
|
|
Y: X:2.345e1 float(0)
|
|
Y: X:1 float(0)
|
|
Y: X: float(0)
|