3v4l.org

run code in 300+ PHP versions simultaneously
<?php $instance = new class {}; $c = get_class($instance); $buf = substr($c, -14); $class_name = "class@anonymous".chr(0).__FILE__.$buf; eval("$class_name extends stdClass {};"); var_dump(new $class_name);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FfH9b
function name:  (null)
number of ops:  23
compiled vars:  !0 = $instance, !1 = $c, !2 = $buf, !3 = $class_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               208     
          1        NEW                                              $5      $4
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $5
    4     4        GET_CLASS                                        ~8      !0
          5        ASSIGN                                                   !1, ~8
    5     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 -14
          9        DO_ICALL                                         $10     
         10        ASSIGN                                                   !2, $10
    7    11        CONCAT                                           ~12     'class%40anonymous%00%2Fin%2FFfH9b', !2
         12        ASSIGN                                                   !3, ~12
    9    13        NOP                                                      
         14        FAST_CONCAT                                      ~14     !3, '+extends+stdClass+%7B%7D%3B'
         15        INCLUDE_OR_EVAL                                          ~14, EVAL
   11    16        INIT_FCALL                                               'var_dump'
         17        FETCH_CLASS                                   0  $16     !3
         18        NEW                                              $17     $16
         19        DO_FCALL                                      0          
         20        SEND_VAR                                                 $17
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.92 ms | 1395 KiB | 17 Q