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){ $a = debug_zval_dump($val); var_dump($a); /* 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 = 41, Position 2 = 51
Branch analysis from position: 41
2 jumps found. (Code = 78) Position 1 = 42, Position 2 = 51
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
filename:       /in/OvlOK
function name:  (null)
number of ops:  53
compiled vars:  !0 = $foo, !1 = $arr, !2 = $headings, !3 = $x, !4 = $y, !5 = $val, !6 = $a
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>
    9    25        ECHO                                                     '%0A'
   11    26        INIT_FCALL                                               'str_pad'
         27        SEND_VAL                                                 'TRUE'
         28        FETCH_CONSTANT                                   ~17     'PAD'
         29        SEND_VAL                                                 ~17
         30        DO_ICALL                                         $18     
         31        CONCAT                                           ~19     $18, '+%7C+'
         32        ASSIGN                                                   !3, ~19
   12    33        INIT_FCALL                                               'str_pad'
         34        SEND_VAL                                                 ''
         35        FETCH_CONSTANT                                   ~21     'PAD'
         36        SEND_VAL                                                 ~21
         37        DO_ICALL                                         $22     
         38        CONCAT                                           ~23     $22, '+%7C+'
         39        ASSIGN                                                   !4, ~23
   14    40      > FE_RESET_R                                       $25     !1, ->51
         41    > > FE_FETCH_R                                               $25, !5, ->51
   15    42    >   INIT_FCALL                                               'debug_zval_dump'
         43        SEND_VAR                                                 !5
         44        DO_ICALL                                         $26     
         45        ASSIGN                                                   !6, $26
   16    46        INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !6
         48        DO_ICALL                                                 
   24    49        ECHO                                                     '%0A'
   14    50      > JMP                                                      ->41
         51    >   FE_FREE                                                  $25
   25    52      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.32 ms | 1400 KiB | 21 Q