3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ThisIsAwful { public static function is($val) { define(get_called_class(), $val); } } spl_autoload_register(function($class) { eval("class $class extends ThisIsAwful {}"); }, true, true); class Test{ public function foo(){echo 'bar';} } You::is(new Test); You();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGeCJ
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'spl_autoload_register'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMGeCJ%3A8%240'
   10     2        SEND_VAL                                                 ~0
          3        SEND_VAL                                                 <true>
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                                 
   14     6        INIT_STATIC_METHOD_CALL                                  'You', 'is'
          7        NEW                                              $2      'Test'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $2
         10        DO_FCALL                                      0          
   15    11        INIT_FCALL_BY_NAME                                       'You'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMGeCJ%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGeCJ
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ROPE_INIT                                     3  ~2      'class+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+extends+ThisIsAwful+%7B%7D'
          4        INCLUDE_OR_EVAL                                          ~1, EVAL
   10     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMGeCJ%3A8%240

Class ThisIsAwful:
Function is:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGeCJ
function name:  is
number of ops:  7
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'define'
          2        GET_CALLED_CLASS                                 ~1      
          3        SEND_VAL                                                 ~1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    5     6      > RETURN                                                   null

End of function is

End of class ThisIsAwful.

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MGeCJ
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'bar'
          1      > RETURN                                                   null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.15 ms | 1400 KiB | 17 Q