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){ var_export($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 = 41, Position 2 = 47
Branch analysis from position: 41
2 jumps found. (Code = 78) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
filename:       /in/SP5ji
function name:  (null)
number of ops:  49
compiled vars:  !0 = $foo, !1 = $arr, !2 = $headings, !3 = $x, !4 = $y, !5 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    4     3        INIT_ARRAY                                       ~9      ''
          4        ADD_ARRAY_ELEMENT                                ~9      '+'
          5        ADD_ARRAY_ELEMENT                                ~9      <false>
          6        ADD_ARRAY_ELEMENT                                ~9      <true>
          7        ADD_ARRAY_ELEMENT                                ~9      <array>
          8        ADD_ARRAY_ELEMENT                                ~9      null
          9        ADD_ARRAY_ELEMENT                                ~9      '0'
         10        ADD_ARRAY_ELEMENT                                ~9      0
         11        ADD_ARRAY_ELEMENT                                ~9      0
         12        NEW                                              $10     'stdClass'
         13        DO_FCALL                                      0          
         14        ADD_ARRAY_ELEMENT                                ~9      $10
         15        ADD_ARRAY_ELEMENT                                ~9      !0
         16        FETCH_OBJ_R                                      ~12     !0, 'bar'
         17        ADD_ARRAY_ELEMENT                                ~9      ~12
         18        ADD_ARRAY_ELEMENT                                ~9      '%00'
         19        ASSIGN                                                   !1, ~9
    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                                   ~16     'PAD'
         29        SEND_VAL                                                 ~16
         30        DO_ICALL                                         $17     
         31        CONCAT                                           ~18     $17, '+%7C+'
         32        ASSIGN                                                   !3, ~18
   12    33        INIT_FCALL                                               'str_pad'
         34        SEND_VAL                                                 ''
         35        FETCH_CONSTANT                                   ~20     'PAD'
         36        SEND_VAL                                                 ~20
         37        DO_ICALL                                         $21     
         38        CONCAT                                           ~22     $21, '+%7C+'
         39        ASSIGN                                                   !4, ~22
   14    40      > FE_RESET_R                                       $24     !1, ->47
         41    > > FE_FETCH_R                                               $24, !5, ->47
   15    42    >   INIT_FCALL                                               'var_export'
         43        SEND_VAR                                                 !5
         44        DO_ICALL                                                 
   23    45        ECHO                                                     '%0A'
   14    46      > JMP                                                      ->41
         47    >   FE_FREE                                                  $24
   24    48      > RETURN                                                   1

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.74 ms | 1392 KiB | 19 Q