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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.5 ms | 1396 KiB | 19 Q