3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register( function($classname) { $obj = new class { const SOME_CONST = 'foo'; // stuff... }; class_alias(get_class($obj), $classname, false); return $obj; } ); $obj = new Foo; var_dump($obj); echo Foo::SOME_CONST;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ar2Et
function name:  (null)
number of ops:  13
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'spl_autoload_register'
    4     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Far2Et%3A4%240'
   11     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   14     4        NEW                                              $3      'Foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   15     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   16    10        FETCH_CLASS_CONSTANT                             ~7      'Foo', 'SOME_CONST'
         11        ECHO                                                     ~7
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Far2Et%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ar2Et
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $classname, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        DECLARE_ANON_CLASS                               1.4822e-323   
          2        NEW                                              $3      $2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    9     5        INIT_FCALL                                               'class_alias'
          6        GET_CLASS                                        ~6      !1
          7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 <false>
         10        DO_ICALL                                                 
   10    11      > RETURN                                                   !1
   11    12*     > RETURN                                                   null

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

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.26 ms | 1396 KiB | 19 Q