3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { public function toCall() { echo 'called'; } public function fromCall(callable $call) { echo 'from'; } public function __construct() { $this->fromCall($this, 'toCall'); } } $myClass = new myClass();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD04K
function name:  (null)
number of ops:  4
compiled vars:  !0 = $myClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class myClass:
Function tocall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD04K
function name:  toCall
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'called'
    6     1      > RETURN                                                   null

End of function tocall

Function fromcall:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD04K
function name:  fromCall
number of ops:  3
compiled vars:  !0 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ECHO                                                     'from'
   10     2      > RETURN                                                   null

End of function fromcall

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD04K
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'fromCall'
          1        FETCH_THIS                                       $0      
          2        SEND_VAR_EX                                              $0
          3        SEND_VAL_EX                                              'toCall'
          4        DO_FCALL                                      0          
   15     5      > RETURN                                                   null

End of function __construct

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.99 ms | 1394 KiB | 13 Q