3v4l.org

run code in 500+ PHP versions simultaneously
<?php spl_autoload_register(function($class){ if ($class == 'MyConcrete') { eval(' class MyConcrete extends MyAbstract { public static function createInstance() {} } '); } elseif ($class == 'MyAbstract') { eval(' abstract class MyAbstract { public abstract static function createInstance(); } '); } else { eval('class '.$class.'{}'); } }); set_error_handler(function($errno, $errstr, $errfile, $errline){ $myclass = new MyClass; }); $concrete = new MyConcrete; $myclass = new MyClass;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sMuKY
function name:  (null)
number of ops:  15
compiled vars:  !0 = $concrete, !1 = $myclass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   18     2        SEND_VAL                                                     ~2
    2     3        DO_ICALL                                                     
   20     4        INIT_FCALL                                                   'set_error_handler'
          5        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
   22     6        SEND_VAL                                                     ~4
   20     7        DO_ICALL                                                     
   24     8        NEW                                                  $6      'MyConcrete'
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !0, $6
   25    11        NEW                                                  $9      'MyClass'
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !1, $9
         14      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sMuKY
function name:  {closure:/in/sMuKY:2}
number of ops:  13
compiled vars:  !0 = $class
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
    3     1        IS_EQUAL                                                     !0, 'MyConcrete'
          2      > JMPZ                                                         ~1, ->5
    4     3    >   INCLUDE_OR_EVAL                                              '%0A++++++++++++++++++++++++class+MyConcrete+extends+MyAbstract+%7B%0A++++++++++++++++++++++++++++++++public+static+function+createInstance%28%29+%7B%7D%0A++++++++++++++++++++++++%7D%0A++++++++++++++++', EVAL
    3     4      > JMP                                                          ->12
    9     5    >   IS_EQUAL                                                     !0, 'MyAbstract'
          6      > JMPZ                                                         ~3, ->9
   10     7    >   INCLUDE_OR_EVAL                                              '%0A++++++++++++++++++++++++abstract+class+MyAbstract+%7B%0A++++++++++++++++++++++++++++++++public+abstract+static+function+createInstance%28%29%3B%0A++++++++++++++++++++++++%7D%0A++++++++++++++++', EVAL
    9     8      > JMP                                                          ->12
   16     9    >   CONCAT                                               ~5      'class+', !0
         10        CONCAT                                               ~6      ~5, '%7B%7D'
         11        INCLUDE_OR_EVAL                                              ~6, EVAL
   18    12    > > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sMuKY
function name:  {closure:/in/sMuKY:20}
number of ops:  8
compiled vars:  !0 = $errno, !1 = $errstr, !2 = $errfile, !3 = $errline, !4 = $myclass
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
          3        RECV                                                 !3      
   21     4        NEW                                                  $5      'MyClass'
          5        DO_FCALL                                          0          
          6        ASSIGN                                                       !4, $5
   22     7      > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
216.46 ms | 2966 KiB | 15 Q