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($b); // -65 decimal var_dump(bin2dec(base_convert($b, 10, 2))); // 65
based on 0EmWn
Output for 7.0.0 - 7.2.0
int(-65) Fatal error: Uncaught Error: Call to undefined function bin2dec() in /in/vJcMo:5 Stack trace: #0 {main} thrown in /in/vJcMo on line 5
Process exited with code 255.
Output for 5.3.22 - 5.6.28
int(-65) Fatal error: Call to undefined function bin2dec() in /in/vJcMo on line 5
Process exited with code 255.