3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar; } $foo = new Foo; $arr = 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" ); define('PAD', array_map('strlen', $arr)); $headings = array('type', 'if', 'isset', 'empty', 'is_null'); // foreach($headings as $heading){ echo str_pad($heading, PAD), " | "; } echo "\n"; $x = str_pad("TRUE", PAD) . " | "; $y = str_pad("", PAD) . " | "; foreach($arr as $key => $val){ echo str_pad($key, PAD), " | "; 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 = 44, Position 2 = 78
Branch analysis from position: 44
2 jumps found. (Code = 78) Position 1 = 45, Position 2 = 78
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 54, Position 2 = 56
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
Branch analysis from position: 74
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 68
Branch analysis from position: 66
Branch analysis from position: 68
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 62
Branch analysis from position: 60
Branch analysis from position: 62
Branch analysis from position: 78
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 78
filename:       /in/qRYJ7
function name:  (null)
number of ops:  80
compiled vars:  !0 = $foo, !1 = $arr, !2 = $headings, !3 = $x, !4 = $y, !5 = $val, !6 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $7
    5     3        INIT_ARRAY                                       ~10     '', 'string%28empty%29+%22%22'
    6     4        ADD_ARRAY_ELEMENT                                ~10     '+', 'string%28space%29+%22+%22'
    5     5        ADD_ARRAY_ELEMENT                                ~10     <false>, 'bool%28false%29'
          6        ADD_ARRAY_ELEMENT                                ~10     <true>, 'bool%28true%29'
          7        ADD_ARRAY_ELEMENT                                ~10     <array>, 'array%28empty%29+%7B%7D'
          8        ADD_ARRAY_ELEMENT                                ~10     null, 'NULL'
   11     9        ADD_ARRAY_ELEMENT                                ~10     '0', 'string%28%22zero%22%29+%220%22'
   12    10        ADD_ARRAY_ELEMENT                                ~10     0, 'int%280%29'
   13    11        ADD_ARRAY_ELEMENT                                ~10     0, 'float%280.0%29'
   14    12        NEW                                              $11     'stdClass'
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~10     $11, 'object%28stdClass%29%23+%28empty%29+%7B%7D'
   15    15        FETCH_OBJ_R                                      ~13     !0, 'bar'
         16        ADD_ARRAY_ELEMENT                                ~10     ~13, 'public+%24bar'
   16    17        ADD_ARRAY_ELEMENT                                ~10     '%00', 'string%28null+byte%29+%22%5C0%22'
    4    18        ASSIGN                                                   !1, ~10
   20    19        INIT_FCALL                                               'define'
         20        SEND_VAL                                                 'PAD'
         21        INIT_FCALL                                               'array_map'
         22        SEND_VAL                                                 'strlen'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $15     
         25        SEND_VAR                                                 $15
         26        DO_ICALL                                                 
   21    27        ASSIGN                                                   !2, <array>
   23    28        ECHO                                                     '%0A'
   25    29        INIT_FCALL                                               'str_pad'
         30        SEND_VAL                                                 'TRUE'
         31        FETCH_CONSTANT                                   ~18     'PAD'
         32        SEND_VAL                                                 ~18
         33        DO_ICALL                                         $19     
         34        CONCAT                                           ~20     $19, '+%7C+'
         35        ASSIGN                                                   !3, ~20
   26    36        INIT_FCALL                                               'str_pad'
         37        SEND_VAL                                                 ''
         38        FETCH_CONSTANT                                   ~22     'PAD'
         39        SEND_VAL                                                 ~22
         40        DO_ICALL                                         $23     
         41        CONCAT                                           ~24     $23, '+%7C+'
         42        ASSIGN                                                   !4, ~24
   28    43      > FE_RESET_R                                       $26     !1, ->78
         44    > > FE_FETCH_R                                       ~27     $26, !5, ->78
         45    >   ASSIGN                                                   !6, ~27
   29    46        INIT_FCALL                                               'str_pad'
         47        SEND_VAR                                                 !6
         48        FETCH_CONSTANT                                   ~29     'PAD'
         49        SEND_VAL                                                 ~29
         50        DO_ICALL                                         $30     
         51        ECHO                                                     $30
         52        ECHO                                                     '+%7C+'
   30    53      > JMPZ                                                     !5, ->56
         54    >   QM_ASSIGN                                        ~31     !3
         55      > JMP                                                      ->57
         56    >   QM_ASSIGN                                        ~31     !4
         57    >   ECHO                                                     ~31
   31    58        ISSET_ISEMPTY_CV                                         !5
         59      > JMPZ                                                     ~32, ->62
         60    >   QM_ASSIGN                                        ~33     !3
         61      > JMP                                                      ->63
         62    >   QM_ASSIGN                                        ~33     !4
         63    >   ECHO                                                     ~33
   32    64        ISSET_ISEMPTY_CV                                         !5
         65      > JMPZ                                                     ~34, ->68
         66    >   QM_ASSIGN                                        ~35     !3
         67      > JMP                                                      ->69
         68    >   QM_ASSIGN                                        ~35     !4
         69    >   ECHO                                                     ~35
   33    70        TYPE_CHECK                                    2          !5
         71      > JMPZ                                                     ~36, ->74
         72    >   QM_ASSIGN                                        ~37     !3
         73      > JMP                                                      ->75
         74    >   QM_ASSIGN                                        ~37     !4
         75    >   ECHO                                                     ~37
   34    76        ECHO                                                     '%0A'
   28    77      > JMP                                                      ->44
         78    >   FE_FREE                                                  $26
   35    79      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.04 ms | 1404 KiB | 19 Q