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), " | "; } $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 = 73, Position 2 = 106
Branch analysis from position: 73
2 jumps found. (Code = 78) Position 1 = 74, Position 2 = 106
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 84
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 90
Branch analysis from position: 88
1 jumps found. (Code = 42) Position 1 = 91
Branch analysis from position: 91
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 96
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 102
Branch analysis from position: 100
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 102
Branch analysis from position: 100
Branch analysis from position: 102
Branch analysis from position: 90
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 96
Branch analysis from position: 94
Branch analysis from position: 96
Branch analysis from position: 84
2 jumps found. (Code = 43) Position 1 = 88, Position 2 = 90
Branch analysis from position: 88
Branch analysis from position: 90
Branch analysis from position: 106
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 106
Branch analysis from position: 59
Branch analysis from position: 43
filename:       /in/G6g5L
function name:  (null)
number of ops:  108
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
   33    60        INIT_FCALL                                               'str_pad'
         61        SEND_VAL                                                 'TRUE'
         62        SEND_VAR                                                 !9
         63        DO_ICALL                                         $43     
         64        CONCAT                                           ~44     $43, '+%7C+'
         65        ASSIGN                                                   !11, ~44
   34    66        INIT_FCALL                                               'str_pad'
         67        SEND_VAL                                                 ''
         68        SEND_VAR                                                 !9
         69        DO_ICALL                                         $46     
         70        CONCAT                                           ~47     $46, '+%7C+'
         71        ASSIGN                                                   !12, ~47
   36    72      > FE_RESET_R                                       $49     !1, ->106
         73    > > FE_FETCH_R                                       ~50     $49, !13, ->106
         74    >   ASSIGN                                                   !14, ~50
   37    75        INIT_FCALL                                               'str_pad'
         76        SEND_VAR                                                 !14
         77        SEND_VAR                                                 !9
         78        DO_ICALL                                         $52     
         79        ECHO                                                     $52
         80        ECHO                                                     '+%7C+'
   38    81      > JMPZ                                                     !13, ->84
         82    >   QM_ASSIGN                                        ~53     !11
         83      > JMP                                                      ->85
         84    >   QM_ASSIGN                                        ~53     !12
         85    >   ECHO                                                     ~53
   39    86        ISSET_ISEMPTY_CV                                         !13
         87      > JMPZ                                                     ~54, ->90
         88    >   QM_ASSIGN                                        ~55     !11
         89      > JMP                                                      ->91
         90    >   QM_ASSIGN                                        ~55     !12
         91    >   ECHO                                                     ~55
   40    92        ISSET_ISEMPTY_CV                                         !13
         93      > JMPZ                                                     ~56, ->96
         94    >   QM_ASSIGN                                        ~57     !11
         95      > JMP                                                      ->97
         96    >   QM_ASSIGN                                        ~57     !12
         97    >   ECHO                                                     ~57
   41    98        TYPE_CHECK                                    2          !13
         99      > JMPZ                                                     ~58, ->102
        100    >   QM_ASSIGN                                        ~59     !11
        101      > JMP                                                      ->103
        102    >   QM_ASSIGN                                        ~59     !12
        103    >   ECHO                                                     ~59
   42   104        ECHO                                                     '%0A'
   36   105      > JMP                                                      ->73
        106    >   FE_FREE                                                  $49
   43   107      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
129.47 ms | 1413 KiB | 17 Q