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) { call_user_func($func, 'bar'); }; } private function do_run($param) { echo 'called ', __METHOD__, " with param '$param'\n"; } } $runner = new Runner(); $runner->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pArtY
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%2FpArtY%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pArtY
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        INIT_USER_CALL                                1          'call_user_func', !0
          2        SEND_USER                                                'bar'
          3        DO_FCALL                                      0          
   12     4      > RETURN                                                   null

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

Class Runner:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pArtY
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/pArtY
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%2FpArtY%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/pArtY
function name:  do_run
number of ops:  8
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ECHO                                                     'called+'
          2        ECHO                                                     'Runner%3A%3Ado_run'
          3        ROPE_INIT                                     3  ~2      '+with+param+%27'
          4        ROPE_ADD                                      1  ~2      ~2, !0
          5        ROPE_END                                      2  ~1      ~2, '%27%0A'
          6        ECHO                                                     ~1
   17     7      > RETURN                                                   null

End of function do_run

End of class Runner.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.88 ms | 1399 KiB | 13 Q