3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 0x80; // 128 base 10 var_dump($a); var_dump(base_convert($a, 10, 2)); // not base_convert($a, 16, 2) $b = ~$a; // -128 - 1 == -129 base 10 var_dump(base_convert($b, 10, 2), $b);// not base_convert($b, 16,2); can base_convert handle negative values? printf("%b", $b); echo "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ikqcm
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 128
    3     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'base_convert'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 10
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
    5    12        BW_NOT                                           ~6      !0
         13        ASSIGN                                                   !1, ~6
    6    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'base_convert'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 10
         18        SEND_VAL                                                 2
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
    7    23        INIT_FCALL                                               'printf'
         24        SEND_VAL                                                 '%25b'
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                                 
    8    27        ECHO                                                     '%0A'
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.49 ms | 1395 KiB | 19 Q