3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $log; function __construct() { $this->log = function () { echo 'log'; }; } private function privateMethod() { echo 'calling private method'; } public function __call($method, $args) { if (is_callable(array($this, $method))) { return call_user_func_array($this->$method, $args); } } } $a = new A(); $a->log(); $a->privateMethod();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N5iFP
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'log'
          4        DO_FCALL                                      0          
   24     5        INIT_METHOD_CALL                                         !0, 'privateMethod'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FN5iFP%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N5iFP
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                     'log'
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FN5iFP%3A8%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N5iFP
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FN5iFP%3A8%240'
          1        ASSIGN_OBJ                                               'log'
          2        OP_DATA                                                  ~1
    9     3      > RETURN                                                   null

End of function __construct

Function privatemethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N5iFP
function name:  privateMethod
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'calling+private+method'
   13     1      > RETURN                                                   null

End of function privatemethod

Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N5iFP
function name:  __call
number of ops:  16
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'is_callable'
          3        FETCH_THIS                                       ~2      
          4        INIT_ARRAY                                       ~3      ~2
          5        ADD_ARRAY_ELEMENT                                ~3      !0
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->15
   17     9    >   FETCH_OBJ_R                                      ~5      !0
         10        INIT_USER_CALL                                0          'call_user_func_array', ~5
         11        SEND_ARRAY                                               !1
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0  $6      
         14      > RETURN                                                   $6
   19    15    > > RETURN                                                   null

End of function __call

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.3 ms | 1400 KiB | 15 Q