3v4l.org

run code in 300+ PHP versions simultaneously
<?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: %d\n\n", $b); printf("\nprintf:%b\n\n",-65); printf("\nprintf: %d\n\n",1111111111111111111111111111111111111111111111111111111110111111b);
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'b' (T_STRING), expecting ',' or ')' in /in/8dYIR on line 14
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17
Parse error: syntax error, unexpected 'b' (T_STRING) in /in/8dYIR on line 14
Process exited with code 255.

preferences:
166.15 ms | 1398 KiB | 28 Q