3v4l.org

run code in 300+ PHP versions simultaneously
<?php //echo acos(3); var_dump(acos(3) === acos(3)); var_dump(acos(3) == acos(3)); // Note that NAN is a float and becomes 0 var_dump($array = [acos(3) => 3]); var_dump(isset($array[acos(3)])); // Idem pour INF, which is infinity var_dump($array = [INF => 3]); var_dump(isset($array[INF]));
Output for 8.5.0 - 8.5.3
bool(false) bool(false) Warning: The float NAN is not representable as an int, cast occurred in /in/N6AoL on line 8 Deprecated: Implicit conversion from float NAN to int loses precision in /in/N6AoL on line 8 array(1) { [0]=> int(3) } Warning: The float NAN is not representable as an int, cast occurred in /in/N6AoL on line 9 Deprecated: Implicit conversion from float NAN to int loses precision in /in/N6AoL on line 9 bool(true) Warning: The float INF is not representable as an int, cast occurred in /in/N6AoL on line 12 array(1) { [0]=> int(3) } Warning: The float INF is not representable as an int, cast occurred in /in/N6AoL on line 13 bool(true)
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18
bool(false) bool(false) Deprecated: Implicit conversion from float NAN to int loses precision in /in/N6AoL on line 8 array(1) { [0]=> int(3) } Deprecated: Implicit conversion from float NAN to int loses precision in /in/N6AoL on line 9 bool(true) Deprecated: Implicit conversion from float INF to int loses precision in /in/N6AoL on line 12 array(1) { [0]=> int(3) } Deprecated: Implicit conversion from float INF to int loses precision in /in/N6AoL on line 13 bool(true)

preferences:
42.61 ms | 735 KiB | 4 Q