3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register('var_dump'); spl_autoload_register(function ($class) { $classData = explode('\\', $class); if (count($classData) > 1) { $name = array_pop($classData); $namespace = implode('\\', $classData); eval('namespace '.$namespace.' { class '.$name.' { } }'); } else { eval('class '.$classData[0].' { }'); } }); new Foo(); new \Faz(); use Foo\Bar; new Bar(); use Foo\Baz as Cat; new Cat(); use Foo\Ciz; new Ciz\Caz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vObtE
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        SEND_VAL                                                 'var_dump'
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'spl_autoload_register'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FvObtE%3A4%240'
   14     5        SEND_VAL                                                 ~1
          6        DO_ICALL                                                 
   16     7        NEW                                              $3      'Foo'
          8        DO_FCALL                                      0          
          9        FREE                                                     $3
   17    10        NEW                                              $5      'Faz'
         11        DO_FCALL                                      0          
         12        FREE                                                     $5
   20    13        NEW                                              $7      'Foo%5CBar'
         14        DO_FCALL                                      0          
         15        FREE                                                     $7
   23    16        NEW                                              $9      'Foo%5CBaz'
         17        DO_FCALL                                      0          
         18        FREE                                                     $9
   26    19        NEW                                              $11     'Foo%5CCiz%5CCaz'
         20        DO_FCALL                                      0          
         21        FREE                                                     $11
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FvObtE%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 24
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vObtE
function name:  {closure}
number of ops:  29
compiled vars:  !0 = $class, !1 = $classData, !2 = $name, !3 = $namespace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%5C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        COUNT                                            ~6      !1
          7        IS_SMALLER                                               1, ~6
          8      > JMPZ                                                     ~7, ->24
    7     9    >   INIT_FCALL                                               'array_pop'
         10        SEND_REF                                                 !1
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
    8    13        INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 '%5C'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !3, $10
    9    18        CONCAT                                           ~12     'namespace+', !3
         19        CONCAT                                           ~13     ~12, '+%7B+class+'
         20        CONCAT                                           ~14     ~13, !2
         21        CONCAT                                           ~15     ~14, '+%7B+%7D+%7D'
         22        INCLUDE_OR_EVAL                                          ~15, EVAL
         23      > JMP                                                      ->28
   11    24    >   FETCH_DIM_R                                      ~17     !1, 0
         25        CONCAT                                           ~18     'class+', ~17
         26        CONCAT                                           ~19     ~18, '+%7B+%7D'
         27        INCLUDE_OR_EVAL                                          ~19, EVAL
   14    28    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FvObtE%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.53 ms | 1400 KiB | 21 Q