3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new class {}; $bar = eval('return new class extends ' . get_class($foo) . ' {}'); var_dump($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ej8aB
function name:  (null)
number of ops:  13
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <true>  
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    4     4        GET_CLASS                                        ~6      !0
          5        CONCAT                                           ~7      'return+new+class+extends+', ~6
          6        CONCAT                                           ~8      ~7, '+%7B%7D'
          7        INCLUDE_OR_EVAL                                  $9      ~8, EVAL
          8        ASSIGN                                                   !1, $9
    5     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.98 ms | 1394 KiB | 15 Q