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', 20); $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 = 40, Position 2 = 74
Branch analysis from position: 40
2 jumps found. (Code = 78) Position 1 = 41, Position 2 = 74
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 70
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 70
Branch analysis from position: 68
Branch analysis from position: 70
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
Branch analysis from position: 64
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
Branch analysis from position: 58
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
filename:       /in/gsq64
function name:  (null)
number of ops:  76
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
   19    19        INIT_FCALL                                               'define'
         20        SEND_VAL                                                 'PAD'
         21        SEND_VAL                                                 20
         22        DO_ICALL                                                 
   20    23        ASSIGN                                                   !2, <array>
   22    24        ECHO                                                     '%0A'
   24    25        INIT_FCALL                                               'str_pad'
         26        SEND_VAL                                                 'TRUE'
         27        FETCH_CONSTANT                                   ~17     'PAD'
         28        SEND_VAL                                                 ~17
         29        DO_ICALL                                         $18     
         30        CONCAT                                           ~19     $18, '+%7C+'
         31        ASSIGN                                                   !3, ~19
   25    32        INIT_FCALL                                               'str_pad'
         33        SEND_VAL                                                 ''
         34        FETCH_CONSTANT                                   ~21     'PAD'
         35        SEND_VAL                                                 ~21
         36        DO_ICALL                                         $22     
         37        CONCAT                                           ~23     $22, '+%7C+'
         38        ASSIGN                                                   !4, ~23
   27    39      > FE_RESET_R                                       $25     !1, ->74
         40    > > FE_FETCH_R                                       ~26     $25, !5, ->74
         41    >   ASSIGN                                                   !6, ~26
   28    42        INIT_FCALL                                               'str_pad'
         43        SEND_VAR                                                 !6
         44        FETCH_CONSTANT                                   ~28     'PAD'
         45        SEND_VAL                                                 ~28
         46        DO_ICALL                                         $29     
         47        ECHO                                                     $29
         48        ECHO                                                     '+%7C+'
   29    49      > JMPZ                                                     !5, ->52
         50    >   QM_ASSIGN                                        ~30     !3
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~30     !4
         53    >   ECHO                                                     ~30
   30    54        ISSET_ISEMPTY_CV                                         !5
         55      > JMPZ                                                     ~31, ->58
         56    >   QM_ASSIGN                                        ~32     !3
         57      > JMP                                                      ->59
         58    >   QM_ASSIGN                                        ~32     !4
         59    >   ECHO                                                     ~32
   31    60        ISSET_ISEMPTY_CV                                         !5
         61      > JMPZ                                                     ~33, ->64
         62    >   QM_ASSIGN                                        ~34     !3
         63      > JMP                                                      ->65
         64    >   QM_ASSIGN                                        ~34     !4
         65    >   ECHO                                                     ~34
   32    66        TYPE_CHECK                                    2          !5
         67      > JMPZ                                                     ~35, ->70
         68    >   QM_ASSIGN                                        ~36     !3
         69      > JMP                                                      ->71
         70    >   QM_ASSIGN                                        ~36     !4
         71    >   ECHO                                                     ~36
   33    72        ECHO                                                     '%0A'
   27    73      > JMP                                                      ->40
         74    >   FE_FREE                                                  $25
   34    75      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.9 ms | 1404 KiB | 17 Q