3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Runner { public function run() { $result = $this->process(); $result(); } private function process() { $func = array($this, 'do_run'); return function() use ($func) { $func(); }; } 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/KBXY9
function name:  (null)
number of ops:  6
compiled vars:  !0 = $runner
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Runner'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'run'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FKBXY9%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBXY9
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0          
   12     3      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FKBXY9%3A10%240

Class Runner:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KBXY9
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/KBXY9
function name:  process
number of ops:  8
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~1      
          1        INIT_ARRAY                                       ~2      ~1
          2        ADD_ARRAY_ELEMENT                                ~2      'do_run'
          3        ASSIGN                                                   !0, ~2
   10     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FKBXY9%3A10%240'
          5        BIND_LEXICAL                                             ~4, !0
   12     6      > RETURN                                                   ~4
   13     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/KBXY9
function name:  do_run
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ECHO                                                     'Runner%3A%3Ado_run'
          1        ECHO                                                     '%0A'
   17     2      > RETURN                                                   null

End of function do_run

End of class Runner.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.16 ms | 1390 KiB | 13 Q