3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new class {}; var_dump(get_class($foo)); $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/YlmcW
function name:  (null)
number of ops:  17
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        INIT_FCALL                                               'var_dump'
          5        GET_CLASS                                        ~6      !0
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
    5     8        GET_CLASS                                        ~8      !0
          9        CONCAT                                           ~9      'return+new+class+extends+', ~8
         10        CONCAT                                           ~10     ~9, '+%7B%7D'
         11        INCLUDE_OR_EVAL                                  $11     ~10, EVAL
         12        ASSIGN                                                   !1, $11
    6    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.44 ms | 1394 KiB | 15 Q