3v4l.org

run code in 300+ PHP versions simultaneously
<?php function call($o, $a, $r, $context) { return call_user_func_array($o, $a); } class A { protected $a = 5; protected function dd() { return 'protected'; } public function __invoke() { $f = function () { return $this->a; }; //return call($f, array(), array(), isset($this) ? $this : null); return call(array($this, 'dd'), array(), array(), isset($this) ? $this : null); } } $a = new A; var_dump($a());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPJnb
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_FCALL                                               'var_dump'
          4        INIT_DYNAMIC_CALL                                        !0
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPJnb
function name:  call
number of ops:  10
compiled vars:  !0 = $o, !1 = $a, !2 = $r, !3 = $context
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
    4     4        INIT_USER_CALL                                0          'call_user_func_array', !0
          5        SEND_ARRAY                                               !1
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0  $4      
          8      > RETURN                                                   $4
    5     9*     > RETURN                                                   null

End of function call

Function %00%7Bclosure%7D%2Fin%2FfPJnb%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPJnb
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_THIS                                       $0      
          1        FETCH_OBJ_R                                      ~1      $0, 'a'
          2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FfPJnb%3A17%240

Class A:
Function dd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPJnb
function name:  dd
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'protected'
   13     1*     > RETURN                                                   null

End of function dd

Function __invoke:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPJnb
function name:  __invoke
number of ops:  19
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FfPJnb%3A17%240'
          1        ASSIGN                                                   !0, ~1
   21     2        INIT_FCALL                                               'call'
          3        FETCH_THIS                                       ~3      
          4        INIT_ARRAY                                       ~4      ~3
          5        ADD_ARRAY_ELEMENT                                ~4      'dd'
          6        SEND_VAL                                                 ~4
          7        SEND_VAL                                                 <array>
          8        SEND_VAL                                                 <array>
          9        ISSET_ISEMPTY_THIS                               ~5      
         10      > JMPZ                                                     ~5, ->14
         11    >   FETCH_THIS                                       ~6      
         12        QM_ASSIGN                                        ~7      ~6
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~7      null
         15    >   SEND_VAL                                                 ~7
         16        DO_FCALL                                      0  $8      
         17      > RETURN                                                   $8
   22    18*     > RETURN                                                   null

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.74 ms | 1403 KiB | 16 Q