3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $callback; public function __construct(Closure $callback){ $callback = $this->callback; $callback(); } public function aaa(){ $this->callback(); } } $a = new A(function () { echo 'a'; }); $a->aaa();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FB5sO
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'A'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFB5sO%3A14%240'
          2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   15     5        INIT_METHOD_CALL                                         !0, 'aaa'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FFB5sO%3A14%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FB5sO
function name:  __construct
number of ops:  6
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_OBJ_R                                      ~1      'callback'
          2        ASSIGN                                                   !0, ~1
    7     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
    8     5      > RETURN                                                   null

End of function __construct

Function aaa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FB5sO
function name:  aaa
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_METHOD_CALL                                         'callback'
          1        DO_FCALL                                      0          
   11     2      > RETURN                                                   null

End of function aaa

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.49 ms | 1386 KiB | 13 Q