3v4l.org

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

Function getnew:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/b7YYj
function name:  getNew
number of ops:  22
compiled vars:  !0 = $a, !1 = $c, !2 = $value, !3 = $k, !4 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FUNC_GET_ARGS                                    ~5      
          1        ASSIGN                                                   !0, ~5
   13     2        INIT_FCALL                                               'array_shift'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
   15     6      > FE_RESET_RW                                      $9      !0, ->12
          7    > > FE_FETCH_RW                                      ~10     $9, !2, ->12
          8    >   ASSIGN                                                   !3, ~10
   16     9        ASSIGN_DIM                                               !0, !3
         10        OP_DATA                                                  !2
   15    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $9
   19    13        NEW                                              $13     'ReflectionClass'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !4, $13
   20    17        INIT_METHOD_CALL                                         !4, 'newInstanceArgs'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0  $16     
         20      > RETURN                                                   $16
   21    21*     > 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/b7YYj
function name:  f
number of ops:  4
compiled vars:  !0 = $e, !1 = $u, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    7     3      > RETURN                                                   null

End of function f

End of class f.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1403 KiB | 18 Q