3v4l.org

run code in 300+ PHP versions simultaneously
<?php class f { function f(&$e){} } function getNew() { $a = func_get_args(); $c = array_shift($a); print_r($a); $r = new ReflectionClass($c); return $r->newInstanceArgs($a); } $e = new stdClass; var_dump(getNew('f', $e));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E6RKo
function name:  (null)
number of ops:  11
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'getnew'
          5        SEND_VAL                                                 'f'
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function getnew:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E6RKo
function name:  getNew
number of ops:  18
compiled vars:  !0 = $a, !1 = $c, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
   11     2        INIT_FCALL                                               'array_shift'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
   12     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   14     9        NEW                                              $8      'ReflectionClass'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $8
   15    13        INIT_METHOD_CALL                                         !2, 'newInstanceArgs'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0  $11     
         16      > RETURN                                                   $11
   16    17*     > RETURN                                                   null

End of function getnew

Class f:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E6RKo
function name:  f
number of ops:  2
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function f

End of class f.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.73 ms | 1399 KiB | 20 Q