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("new $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/BQQQM
function name:  (null)
number of ops:  24
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%2FBQQQM', !2
         12        ASSIGN                                                   !3, ~12
    9    13        ROPE_INIT                                     3  ~15     'new+'
         14        ROPE_ADD                                      1  ~15     ~15, !3
         15        ROPE_END                                      2  ~14     ~15, '+extends+stdClass+%7B%7D%3B'
         16        INCLUDE_OR_EVAL                                          ~14, EVAL
   11    17        INIT_FCALL                                               'var_dump'
         18        FETCH_CLASS                                   0  $18     !3
         19        NEW                                              $19     $18
         20        DO_FCALL                                      0          
         21        SEND_VAR                                                 $19
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.17 ms | 1395 KiB | 17 Q