3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { } class Processor { public function import() { $this->process(function ($data) { return $this->update($data); }); } public function process(Closure $callback) { $data = range(1, 10); foreach ($data as $d) { $callback($d); } } public function update($data) { var_dump($data); } } $processor = new Processor(); $processor->import();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiesS
function name:  (null)
number of ops:  6
compiled vars:  !0 = $processor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   NEW                                              $1      'Processor'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   34     3        INIT_METHOD_CALL                                         !0, 'import'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FQiesS%3A13%240

Class Model: [no user functions]
Class Processor:
Function import:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiesS
function name:  import
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_METHOD_CALL                                         'process'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQiesS%3A13%240'
   15     2        SEND_VAL_EX                                              ~0
          3        DO_FCALL                                      0          
   16     4      > RETURN                                                   null

End of function import

Function process:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/QiesS
function name:  process
number of ops:  14
compiled vars:  !0 = $callback, !1 = $data, !2 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   21     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 10
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   22     6      > FE_RESET_R                                       $5      !1, ->12
          7    > > FE_FETCH_R                                               $5, !2, ->12
   23     8    >   INIT_DYNAMIC_CALL                                        !0
          9        SEND_VAR_EX                                              !2
         10        DO_FCALL                                      0          
   22    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $5
   25    13      > RETURN                                                   null

End of function process

Function update:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QiesS
function name:  update
number of ops:  5
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   29     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   30     4      > RETURN                                                   null

End of function update

End of class Processor.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.98 ms | 1400 KiB | 17 Q