3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Runner { public function run() { $result = $this->process(); $result(); } private function process() { return function() { $this->do_run(); }; $runner = $this; return function() use ($runner) { $runner->do_run(); }; } private function do_run() { echo __METHOD__, "\n"; } } $runner = new Runner(); $runner->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  (null)
number of ops:  6
compiled vars:  !0 = $runner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Runner'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZ84mG%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  {closure}
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'do_run'
          2        DO_FCALL                                      0          
   11     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZ84mG%3A9%240

Function %00%7Bclosure%7D%2Fin%2FZ84mG%3A13%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $runner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   14     1        INIT_METHOD_CALL                                         !0, 'do_run'
          2        DO_FCALL                                      0          
   15     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZ84mG%3A13%241

Class Runner:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  run
number of ops:  6
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_METHOD_CALL                                         'process'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    5     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
    6     5      > RETURN                                                   null

End of function run

Function process:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  process
number of ops:  8
compiled vars:  !0 = $runner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZ84mG%3A9%240'
   11     1      > RETURN                                                   ~1
   12     2*       FETCH_THIS                                       ~2      
          3*       ASSIGN                                                   !0, ~2
   13     4*       DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZ84mG%3A13%241'
          5*       BIND_LEXICAL                                             ~4, !0
   15     6*       RETURN                                                   ~4
   16     7*     > RETURN                                                   null

End of function process

Function do_run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z84mG
function name:  do_run
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'Runner%3A%3Ado_run'
          1        ECHO                                                     '%0A'
   20     2      > RETURN                                                   null

End of function do_run

End of class Runner.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1399 KiB | 13 Q