3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Legumes { class Batata { } } // volta p global namespace { $classe = 'Batata'; // Cuidado especial com a barra invertida, ela é utilizada como escape $fqn = "\\Legumes\\{$classe}"; $instance = new $fqn; var_dump($instance); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q4uU3
function name:  (null)
number of ops:  12
compiled vars:  !0 = $classe, !1 = $fqn, !2 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'Batata'
   16     1        NOP                                                      
          2        FAST_CONCAT                                      ~4      '%5CLegumes%5C', !0
          3        ASSIGN                                                   !1, ~4
   18     4        FETCH_CLASS                                   0  $6      !1
          5        NEW                                              $7      $6
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
   20     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   21    11      > RETURN                                                   1

Class Legumes\Batata: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
125.64 ms | 1443 KiB | 14 Q