3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar; } $foo = new Foo; $blanks = array( "string(empty) \"\"" => "", "string(space) \" \"" => " ", "bool(false)" => FALSE, "bool(true)" => TRUE, "array(empty) {}" => array(), "NULL" => NULL, "string(\"zero\") \"0\"" => "0", "int(0)" => 0, "float(0.0)" => 0.0, "object(stdClass)# (empty) {}" => new stdClass, "public \$bar" => $foo->bar, "string(null byte) \"\\0\"" => "\0" ); $headings = array('type', 'if', 'isset', 'empty', 'is_null'); foreach(array($headings, array_keys($blanks)) as $ord => $arr){ foreach($arr as $val){ static $max = 0; if(strlen($val) > $max){ $max = strlen($val); } } ${"pad_$ord"} = $max; } for($i = 0; $i < count($headings); $i++){ echo str_pad($headings[$i], ${'pad_' . ($i/$i)}), "|"; } /* $x = str_pad("TRUE", PAD_1) . " | "; $y = str_pad("", PAD_1) . " | "; foreach($arr as $key => $val){ echo str_pad($key, max(array_map('strlen', array_keys($arr)))), " | "; echo $val ? $x : $y; echo isset($val) ? $x : $y; echo empty($val) ? $x : $y; echo is_null($val) ? $x : $y; echo "\n"; } */
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 43
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 43
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 37
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 37
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 37
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 46
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 60, Position 2 = 46
Branch analysis from position: 60
Branch analysis from position: 46
Branch analysis from position: 43
filename:       /in/P2NLC
function name:  (null)
number of ops:  61
compiled vars:  !0 = $foo, !1 = $blanks, !2 = $headings, !3 = $arr, !4 = $ord, !5 = $val, !6 = $max, !7 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $8      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $8
    5     3        INIT_ARRAY                                       ~11     '', 'string%28empty%29+%22%22'
    6     4        ADD_ARRAY_ELEMENT                                ~11     '+', 'string%28space%29+%22+%22'
    5     5        ADD_ARRAY_ELEMENT                                ~11     <false>, 'bool%28false%29'
          6        ADD_ARRAY_ELEMENT                                ~11     <true>, 'bool%28true%29'
          7        ADD_ARRAY_ELEMENT                                ~11     <array>, 'array%28empty%29+%7B%7D'
          8        ADD_ARRAY_ELEMENT                                ~11     null, 'NULL'
   11     9        ADD_ARRAY_ELEMENT                                ~11     '0', 'string%28%22zero%22%29+%220%22'
   12    10        ADD_ARRAY_ELEMENT                                ~11     0, 'int%280%29'
   13    11        ADD_ARRAY_ELEMENT                                ~11     0, 'float%280.0%29'
   14    12        NEW                                              $12     'stdClass'
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~11     $12, 'object%28stdClass%29%23+%28empty%29+%7B%7D'
   15    15        FETCH_OBJ_R                                      ~14     !0, 'bar'
         16        ADD_ARRAY_ELEMENT                                ~11     ~14, 'public+%24bar'
   16    17        ADD_ARRAY_ELEMENT                                ~11     '%00', 'string%28null+byte%29+%22%5C0%22'
    4    18        ASSIGN                                                   !1, ~11
   20    19        ASSIGN                                                   !2, <array>
   21    20        INIT_ARRAY                                       ~17     !2
         21        INIT_FCALL                                               'array_keys'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $18     
         24        ADD_ARRAY_ELEMENT                                ~17     $18
         25      > FE_RESET_R                                       $19     ~17, ->43
         26    > > FE_FETCH_R                                       ~20     $19, !3, ->43
         27    >   ASSIGN                                                   !4, ~20
   22    28      > FE_RESET_R                                       $22     !3, ->37
         29    > > FE_FETCH_R                                               $22, !5, ->37
   23    30    >   BIND_STATIC                                              !6
   24    31        STRLEN                                           ~23     !5
         32        IS_SMALLER                                               !6, ~23
         33      > JMPZ                                                     ~24, ->36
         34    >   STRLEN                                           ~25     !5
         35        ASSIGN                                                   !6, ~25
   22    36    > > JMP                                                      ->29
         37    >   FE_FREE                                                  $22
   26    38        NOP                                                      
         39        FAST_CONCAT                                      ~27     'pad_', !4
         40        FETCH_W                      local               $28     ~27
         41        ASSIGN                                                   $28, !6
   21    42      > JMP                                                      ->26
         43    >   FE_FREE                                                  $19
   29    44        ASSIGN                                                   !7, 0
         45      > JMP                                                      ->57
   30    46    >   INIT_FCALL                                               'str_pad'
         47        FETCH_DIM_R                                      ~31     !2, !7
         48        SEND_VAL                                                 ~31
         49        DIV                                              ~32     !7, !7
         50        CONCAT                                           ~33     'pad_', ~32
         51        FETCH_R                      local               ~34     ~33
         52        SEND_VAL                                                 ~34
         53        DO_ICALL                                         $35     
         54        ECHO                                                     $35
         55        ECHO                                                     '%7C'
   29    56        PRE_INC                                                  !7
         57    >   COUNT                                            ~37     !2
         58        IS_SMALLER                                               !7, ~37
         59      > JMPNZ                                                    ~38, ->46
   45    60    > > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.38 ms | 1392 KiB | 17 Q