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; } foreach($headings as $i => $heading){ echo str_pad($heading, $i == 0 ? $pad_1 : $pad_0), " | "; } echo "\n"; $true = str_pad("TRUE", $pad_1) . " | "; $false = str_pad("", $pad_1) . " | "; foreach($blanks as $readable => $blank){ echo str_pad($readable, $pad_1), " | "; echo $blank ? $true : $false; echo isset($blank) ? $true : $false; echo empty($blank) ? $true : $false; echo is_null($blank) ? $true : $false; 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
2 jumps found. (Code = 77) Position 1 = 45, Position 2 = 59
Branch analysis from position: 45
2 jumps found. (Code = 78) Position 1 = 46, Position 2 = 59
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 53
Branch analysis from position: 51
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 59
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 107
Branch analysis from position: 74
2 jumps found. (Code = 78) Position 1 = 75, Position 2 = 107
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 85
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 91
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 92
Branch analysis from position: 92
2 jumps found. (Code = 43) Position 1 = 95, Position 2 = 97
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 98
Branch analysis from position: 98
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 103
Branch analysis from position: 101
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 97
2 jumps found. (Code = 43) Position 1 = 101, Position 2 = 103
Branch analysis from position: 101
Branch analysis from position: 103
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 95, Position 2 = 97
Branch analysis from position: 95
Branch analysis from position: 97
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 91
Branch analysis from position: 89
Branch analysis from position: 91
Branch analysis from position: 107
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 107
Branch analysis from position: 59
Branch analysis from position: 43
filename:       /in/8berF
function name:  (null)
number of ops:  109
compiled vars:  !0 = $foo, !1 = $blanks, !2 = $headings, !3 = $arr, !4 = $ord, !5 = $val, !6 = $max, !7 = $heading, !8 = $i, !9 = $pad_1, !10 = $pad_0, !11 = $true, !12 = $false, !13 = $blank, !14 = $readable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $15     'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $15
    5     3        INIT_ARRAY                                       ~18     '', 'string%28empty%29+%22%22'
    6     4        ADD_ARRAY_ELEMENT                                ~18     '+', 'string%28space%29+%22+%22'
    5     5        ADD_ARRAY_ELEMENT                                ~18     <false>, 'bool%28false%29'
          6        ADD_ARRAY_ELEMENT                                ~18     <true>, 'bool%28true%29'
          7        ADD_ARRAY_ELEMENT                                ~18     <array>, 'array%28empty%29+%7B%7D'
          8        ADD_ARRAY_ELEMENT                                ~18     null, 'NULL'
   11     9        ADD_ARRAY_ELEMENT                                ~18     '0', 'string%28%22zero%22%29+%220%22'
   12    10        ADD_ARRAY_ELEMENT                                ~18     0, 'int%280%29'
   13    11        ADD_ARRAY_ELEMENT                                ~18     0, 'float%280.0%29'
   14    12        NEW                                              $19     'stdClass'
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~18     $19, 'object%28stdClass%29%23+%28empty%29+%7B%7D'
   15    15        FETCH_OBJ_R                                      ~21     !0, 'bar'
         16        ADD_ARRAY_ELEMENT                                ~18     ~21, 'public+%24bar'
   16    17        ADD_ARRAY_ELEMENT                                ~18     '%00', 'string%28null+byte%29+%22%5C0%22'
    4    18        ASSIGN                                                   !1, ~18
   20    19        ASSIGN                                                   !2, <array>
   21    20        INIT_ARRAY                                       ~24     !2
         21        INIT_FCALL                                               'array_keys'
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $25     
         24        ADD_ARRAY_ELEMENT                                ~24     $25
         25      > FE_RESET_R                                       $26     ~24, ->43
         26    > > FE_FETCH_R                                       ~27     $26, !3, ->43
         27    >   ASSIGN                                                   !4, ~27
   22    28      > FE_RESET_R                                       $29     !3, ->37
         29    > > FE_FETCH_R                                               $29, !5, ->37
   23    30    >   BIND_STATIC                                              !6
   24    31        STRLEN                                           ~30     !5
         32        IS_SMALLER                                               !6, ~30
         33      > JMPZ                                                     ~31, ->36
         34    >   STRLEN                                           ~32     !5
         35        ASSIGN                                                   !6, ~32
   22    36    > > JMP                                                      ->29
         37    >   FE_FREE                                                  $29
   26    38        NOP                                                      
         39        FAST_CONCAT                                      ~34     'pad_', !4
         40        FETCH_W                      local               $35     ~34
         41        ASSIGN                                                   $35, !6
   21    42      > JMP                                                      ->26
         43    >   FE_FREE                                                  $26
   29    44      > FE_RESET_R                                       $37     !2, ->59
         45    > > FE_FETCH_R                                       ~38     $37, !7, ->59
         46    >   ASSIGN                                                   !8, ~38
   30    47        INIT_FCALL                                               'str_pad'
         48        SEND_VAR                                                 !7
         49        IS_EQUAL                                                 !8, 0
         50      > JMPZ                                                     ~40, ->53
         51    >   QM_ASSIGN                                        ~41     !9
         52      > JMP                                                      ->54
         53    >   QM_ASSIGN                                        ~41     !10
         54    >   SEND_VAL                                                 ~41
         55        DO_ICALL                                         $42     
         56        ECHO                                                     $42
         57        ECHO                                                     '+%7C+'
   29    58      > JMP                                                      ->45
         59    >   FE_FREE                                                  $37
   32    60        ECHO                                                     '%0A'
   34    61        INIT_FCALL                                               'str_pad'
         62        SEND_VAL                                                 'TRUE'
         63        SEND_VAR                                                 !9
         64        DO_ICALL                                         $43     
         65        CONCAT                                           ~44     $43, '+%7C+'
         66        ASSIGN                                                   !11, ~44
   35    67        INIT_FCALL                                               'str_pad'
         68        SEND_VAL                                                 ''
         69        SEND_VAR                                                 !9
         70        DO_ICALL                                         $46     
         71        CONCAT                                           ~47     $46, '+%7C+'
         72        ASSIGN                                                   !12, ~47
   37    73      > FE_RESET_R                                       $49     !1, ->107
         74    > > FE_FETCH_R                                       ~50     $49, !13, ->107
         75    >   ASSIGN                                                   !14, ~50
   38    76        INIT_FCALL                                               'str_pad'
         77        SEND_VAR                                                 !14
         78        SEND_VAR                                                 !9
         79        DO_ICALL                                         $52     
         80        ECHO                                                     $52
         81        ECHO                                                     '+%7C+'
   39    82      > JMPZ                                                     !13, ->85
         83    >   QM_ASSIGN                                        ~53     !11
         84      > JMP                                                      ->86
         85    >   QM_ASSIGN                                        ~53     !12
         86    >   ECHO                                                     ~53
   40    87        ISSET_ISEMPTY_CV                                         !13
         88      > JMPZ                                                     ~54, ->91
         89    >   QM_ASSIGN                                        ~55     !11
         90      > JMP                                                      ->92
         91    >   QM_ASSIGN                                        ~55     !12
         92    >   ECHO                                                     ~55
   41    93        ISSET_ISEMPTY_CV                                         !13
         94      > JMPZ                                                     ~56, ->97
         95    >   QM_ASSIGN                                        ~57     !11
         96      > JMP                                                      ->98
         97    >   QM_ASSIGN                                        ~57     !12
         98    >   ECHO                                                     ~57
   42    99        TYPE_CHECK                                    2          !13
        100      > JMPZ                                                     ~58, ->103
        101    >   QM_ASSIGN                                        ~59     !11
        102      > JMP                                                      ->104
        103    >   QM_ASSIGN                                        ~59     !12
        104    >   ECHO                                                     ~59
   43   105        ECHO                                                     '%0A'
   37   106      > JMP                                                      ->74
        107    >   FE_FREE                                                  $49
   44   108      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.31 ms | 1408 KiB | 17 Q