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); var_dump($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/ZvCr3
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 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 126) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/ZvCr3
function name:  getNew
number of ops:  22
compiled vars:  !0 = $a, !1 = $c, !2 = $value, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FUNC_GET_ARGS                                    ~4      
          1        ASSIGN                                                   !0, ~4
   13     2        INIT_FCALL                                               'array_shift'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
   14     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   15     9      > FE_RESET_RW                                      $9      !0, ->15
         10    > > FE_FETCH_RW                                      ~10     $9, !2, ->15
         11    >   ASSIGN                                                   !3, ~10
   16    12        ASSIGN_DIM                                               !0, !3
         13        OP_DATA                                                  !2
   15    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $9
   18    16        INIT_USER_CALL                                0          'call_user_func_array', <array>
         17        SEND_ARRAY                                               !1
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      0  $13     
         20      > RETURN                                                   $13
   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/ZvCr3
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:
171.85 ms | 1402 KiB | 18 Q