3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prout() { static $u = null; echo 'prout'; if ($u === null) { $u = 4; return 4; } return 5; } function pouet() { if (prout() === 4) { yield 'a'; } yield 'b'; } foreach (pouet() as $letter) { echo $letter; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/dtBIn
function name:  (null)
number of ops:  8
compiled vars:  !0 = $letter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'pouet'
          1        DO_FCALL                                      0  $1      
          2      > FE_RESET_R                                       $2      $1, ->6
          3    > > FE_FETCH_R                                               $2, !0, ->6
   26     4    >   ECHO                                                     !0
   25     5      > JMP                                                      ->3
          6    >   FE_FREE                                                  $2
   27     7      > RETURN                                                   1

Function prout:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dtBIn
function name:  prout
number of ops:  8
compiled vars:  !0 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    7     1        ECHO                                                     'prout'
    9     2        TYPE_CHECK                                    2          !0
          3      > JMPZ                                                     ~1, ->6
   10     4    >   ASSIGN                                                   !0, 4
   11     5      > RETURN                                                   4
   14     6    > > RETURN                                                   5
   15     7*     > RETURN                                                   null

End of function prout

Function pouet:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 6
filename:       /in/dtBIn
function name:  pouet
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   GENERATOR_CREATE                                         
   19     1        INIT_FCALL                                               'prout'
          2        DO_FCALL                                      0  $0      
          3        IS_IDENTICAL                                             $0, 4
          4      > JMPZ                                                     ~1, ->6
   20     5    >   YIELD                                                    'a'
   22     6    >   YIELD                                                    'b'
   23     7      > GENERATOR_RETURN                                         

End of function pouet

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.99 ms | 1399 KiB | 15 Q