3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Example { private $events; private function loopView() { $this->events = ['an event', 'another']; } public function print() { self::loopView(); return function() { foreach ($this->events as $event) echo "$event\n"; }; } } $example = new Example; $eventPrinter = $example->print(); $eventPrinter();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gYdHp
function name:  (null)
number of ops:  9
compiled vars:  !0 = $example, !1 = $eventPrinter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   NEW                                                  $2      'Example'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   21     3        INIT_METHOD_CALL                                             !0, 'print'
          4        DO_FCALL                                          0  $5      
          5        ASSIGN                                                       !1, $5
   22     6        INIT_DYNAMIC_CALL                                            !1
          7        DO_FCALL                                          0          
          8      > RETURN                                                       1

Class Example:
Function loopview:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gYdHp
function name:  loopView
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ASSIGN_OBJ                                                   'events'
          1        OP_DATA                                                      <array>
    9     2      > RETURN                                                       null

End of function loopview

Function print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gYdHp
function name:  print
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                      'loopView'
          1        DO_FCALL                                          0          
   13     2        DECLARE_LAMBDA_FUNCTION                              ~1      [0]
   16     3      > RETURN                                                       ~1
   17     4*     > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/gYdHp
function name:  {closure:Example::print():13}
number of ops:  9
compiled vars:  !0 = $event
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                          ~1      'events'
          1      > FE_RESET_R                                           $2      ~1, ->7
          2    > > FE_FETCH_R                                                   $2, !0, ->7
   15     3    >   NOP                                                          
          4        FAST_CONCAT                                          ~3      !0, '%0A'
          5        ECHO                                                         ~3
   14     6      > JMP                                                          ->2
          7    >   FE_FREE                                                      $2
   16     8      > RETURN                                                       null

End of Dynamic Function 0

End of function print

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
440.33 ms | 1711 KiB | 8 Q