3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A\B; class Continent { } $objectName = 'Continent'; print $objectName; // Continent new Continent; // Works $class = '\A\B\\' . $objectName; // new $class; // Works new $objectName; // Fatal error: Class 'Continent' not found
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0s6in
function name:  (null)
number of ops:  16
compiled vars:  !0 = $objectName, !1 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 'Continent'
    9     1        ECHO                                                     !0
   11     2        NEW                                              $3      'A%5CB%5CContinent'
          3        DO_FCALL                                      0          
          4        FREE                                                     $3
   13     5        CONCAT                                           ~5      '%5CA%5CB%5C', !0
          6        ASSIGN                                                   !1, ~5
   14     7        FETCH_CLASS                                   0  $7      !1
          8        NEW                                              $8      $7
          9        DO_FCALL                                      0          
         10        FREE                                                     $8
   16    11        FETCH_CLASS                                   0  $10     !0
         12        NEW                                              $11     $10
         13        DO_FCALL                                      0          
         14        FREE                                                     $11
         15      > RETURN                                                   1

Class A\B\Continent: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.82 ms | 1393 KiB | 13 Q