3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); function load($test) { $logger->log[] = array('load', __FILE__, $test); return new $test(); } class foo {} $result = load('foo'); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJD7a
function name:  (null)
number of ops:  11
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 -1
          2        DO_ICALL                                                 
   12     3        INIT_FCALL                                               'load'
          4        SEND_VAL                                                 'foo'
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                                   !0, $2
   13     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function load:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJD7a
function name:  load
number of ops:  12
compiled vars:  !0 = $test, !1 = $logger
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_ARRAY                                       ~4      'load'
          2        ADD_ARRAY_ELEMENT                                ~4      '%2Fin%2FFJD7a'
          3        ADD_ARRAY_ELEMENT                                ~4      !0
          4        FETCH_OBJ_W                                      $2      !1, 'log'
          5        ASSIGN_DIM                                               $2
          6        OP_DATA                                                  ~4
    7     7        FETCH_CLASS                                   0  $5      !0
          8        NEW                                              $6      $5
          9        DO_FCALL                                      0          
         10      > RETURN                                                   $6
    8    11*     > RETURN                                                   null

End of function load

Class foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.26 ms | 1402 KiB | 18 Q