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($b); $res = $b + 0; var_dump($res); 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\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qsOrq
function name:  (null)
number of ops:  37
compiled vars:  !0 = $a, !1 = $b, !2 = $res
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                                         $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
    5    12        BW_NOT                                           ~7      !0
         13        ASSIGN                                                   !1, ~7
    6    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
    7    17        ADD                                              ~10     !1, 0
         18        ASSIGN                                                   !2, ~10
    8    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !2
         21        DO_ICALL                                                 
    9    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'base_convert'
         24        SEND_VAR                                                 !1
         25        SEND_VAL                                                 10
         26        SEND_VAL                                                 2
         27        DO_ICALL                                         $13     
         28        SEND_VAR                                                 $13
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
   10    31        INIT_FCALL                                               'printf'
         32        SEND_VAL                                                 '%25b'
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                                 
   11    35        ECHO                                                     '%0A%0A'
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.65 ms | 1401 KiB | 19 Q