3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function foo() { echo "I am only called once.\n"; return array('a', 'b', 'c', 'd', 'e'); } } $test = new Test(); foreach ($y = $test->foo() as $value) { echo $value . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/VCTUT
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test, !1 = $y, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $3      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   15     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                           ~7      !1, $6
          6      > FE_RESET_R                                       $8      ~7, ->11
          7    > > FE_FETCH_R                                               $8, !2, ->11
   16     8    >   CONCAT                                           ~9      !2, '%0A'
          9        ECHO                                                     ~9
   15    10      > JMP                                                      ->7
         11    >   FE_FREE                                                  $8
   17    12      > RETURN                                                   1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VCTUT
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'I+am+only+called+once.%0A'
    9     1      > RETURN                                                   <array>
   10     2*     > RETURN                                                   null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.87 ms | 1398 KiB | 13 Q