3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 0x40; $b = ~$a; // flip bits, i.e. 2s complement so -$a and then minus 1 var_dump("var_dump: $b"); // -65 printf("\nprintf: %d\n\n", $b); var_dump( base_convert($b, 10, 2) ); // 65 // **************************// // should be: printf("\nprintf: %b\n\n", $b); echo hexbin(0x40);
based on UjRGc
Output for 7.0.0 - 7.2.0
string(13) "var_dump: -65" printf: -65 string(7) "1000001" printf: 1111111111111111111111111111111111111111111111111111111110111111 Fatal error: Uncaught Error: Call to undefined function hexbin() in /in/o9NmB:13 Stack trace: #0 {main} thrown in /in/o9NmB on line 13
Process exited with code 255.
Output for 5.3.22 - 5.6.28
string(13) "var_dump: -65" printf: -65 string(7) "1000001" printf: 1111111111111111111111111111111111111111111111111111111110111111 Fatal error: Call to undefined function hexbin() in /in/o9NmB on line 13
Process exited with code 255.