3v4l.org

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

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.31 ms | 1404 KiB | 17 Q