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("$x = new $class_name {};"); var_dump($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cInXT
function name:  (null)
number of ops:  22
compiled vars:  !0 = $instance, !1 = $c, !2 = $buf, !3 = $class_name, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $6      $5
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $6
    4     4        GET_CLASS                                        ~9      !0
          5        ASSIGN                                                   !1, ~9
    5     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 -14
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !2, $11
    7    11        CONCAT                                           ~13     'class%40anonymous%00%2Fin%2FcInXT', !2
         12        ASSIGN                                                   !3, ~13
    9    13        ROPE_INIT                                     4  ~16     !4
         14        ROPE_ADD                                      1  ~16     ~16, '+%3D+new+'
         15        ROPE_ADD                                      2  ~16     ~16, !3
         16        ROPE_END                                      3  ~15     ~16, '+%7B%7D%3B'
         17        INCLUDE_OR_EVAL                                          ~15, EVAL
   11    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.99 ms | 1395 KiB | 17 Q