3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = -65; printf("%d is 0x%x\n",$n,$n); $hex = sprintf("%x",$n); var_dump($hex + 0); printf("\n%d\n","0x".$hex + 0); $x = "0x".$hex; echo $x+0;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
-65 is 0xffffffffffffffbf Fatal error: Uncaught TypeError: Unsupported operand types: string + int in /in/XUs6p:6 Stack trace: #0 {main} thrown in /in/XUs6p on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/XUs6p on line 7 -65 is 0xffffffffffffffbf Warning: A non-numeric value encountered in /in/XUs6p on line 6 int(0) Notice: A non well formed numeric value encountered in /in/XUs6p on line 7 0 Notice: A non well formed numeric value encountered in /in/XUs6p on line 9 0
Output for 7.3.32 - 7.3.33
-65 is 0xffffffffffffffbf Warning: A non-numeric value encountered in /in/XUs6p on line 6 int(0) 0 0
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
-65 is 0xffffffffffffffbf Warning: A non-numeric value encountered in /in/XUs6p on line 6 int(0) Notice: A non well formed numeric value encountered in /in/XUs6p on line 7 0 Notice: A non well formed numeric value encountered in /in/XUs6p on line 9 0
Output for 7.0.0 - 7.0.33
-65 is 0xffffffffffffffbf int(0) 0 0
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
-65 is 0xffffffffffffffbf int(0) 0 1.844674407371E+19

preferences:
227.48 ms | 402 KiB | 332 Q