3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace MiProyecto; function obtener($nombreclase) { $a = __NAMESPACE__ . '\\' . $nombreclase; echo $a; return new $a; } $a = obtener('nuevaClase'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y62B0
function name:  (null)
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_NS_FCALL_BY_NAME                                    'MiProyecto%5Cobtener'
          1        SEND_VAL_EX                                              'nuevaClase'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   13     4      > RETURN                                                   1

Function miproyecto%5Cobtener:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y62B0
function name:  MiProyecto\obtener
number of ops:  9
compiled vars:  !0 = $nombreclase, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        CONCAT                                           ~2      'MiProyecto%5C', !0
          2        ASSIGN                                                   !1, ~2
    7     3        ECHO                                                     !1
    8     4        FETCH_CLASS                                   0  $4      !1
          5        NEW                                              $5      $4
          6        DO_FCALL                                      0          
          7      > RETURN                                                   $5
    9     8*     > RETURN                                                   null

End of function miproyecto%5Cobtener

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.32 ms | 1388 KiB | 14 Q