3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Invokable { private $callCount = 0; public function __invoke() { $this->callCount++; return $this->callCount; } } class Example { private $invokable; public function __construct() { $this->invokable = new Invokable(); } public function getInvokable0() { $invokable = $this->invokable; return $invokable(); } } $eg = new Example(); printf("%d\n",$eg->getInvokable0());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uqit
function name:  (null)
number of ops:  10
compiled vars:  !0 = $eg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_FCALL                                               'printf'
          4        SEND_VAL                                                 '%25d%0A'
          5        INIT_METHOD_CALL                                         !0, 'getInvokable0'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Invokable:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uqit
function name:  __invoke
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   PRE_INC_OBJ                                              'callCount'
   11     1        FETCH_OBJ_R                                      ~1      'callCount'
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function __invoke

End of class Invokable.

Class Example:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uqit
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Invokable'
          1        DO_FCALL                                      0          
          2        ASSIGN_OBJ                                               'invokable'
          3        OP_DATA                                                  $1
   21     4      > RETURN                                                   null

End of function __construct

Function getinvokable0:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4uqit
function name:  getInvokable0
number of ops:  6
compiled vars:  !0 = $invokable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~1      'invokable'
          1        ASSIGN                                                   !0, ~1
   27     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $3      
          4      > RETURN                                                   $3
   28     5*     > RETURN                                                   null

End of function getinvokable0

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.19 ms | 1396 KiB | 15 Q