3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateAnimal() { echo "Je suis dans le générateur\n"; yield "Panda"; echo "Je suis retourné dans le générateur\n"; yield "Lama"; echo "je suis de retour\n"; yield "Alpaga"; echo "plus de d'animaux\n"; } $generator = generateAnimal(); foreach ($generator as $value) { echo "j'ai reçu $value \n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/CNJi4
function name:  (null)
number of ops:  12
compiled vars:  !0 = $generator, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'generateanimal'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   14     3      > FE_RESET_R                                       $4      !0, ->10
          4    > > FE_FETCH_R                                               $4, !1, ->10
   15     5    >   ROPE_INIT                                     3  ~6      'j%27ai+re%C3%A7u+'
          6        ROPE_ADD                                      1  ~6      ~6, !1
          7        ROPE_END                                      2  ~5      ~6, '+%0A'
          8        ECHO                                                     ~5
   14     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $4
   16    11      > RETURN                                                   1

Function generateanimal:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/CNJi4
function name:  generateAnimal
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ECHO                                                     'Je+suis+dans+le+g%C3%A9n%C3%A9rateur%0A'
    5     2        YIELD                                                    'Panda'
    6     3        ECHO                                                     'Je+suis+retourn%C3%A9+dans+le+g%C3%A9n%C3%A9rateur%0A'
    7     4        YIELD                                                    'Lama'
    8     5        ECHO                                                     'je+suis+de+retour%0A'
    9     6        YIELD                                                    'Alpaga'
   10     7        ECHO                                                     'plus+de+d%27animaux%0A'
   11     8      > GENERATOR_RETURN                                         

End of function generateanimal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
276.97 ms | 1402 KiB | 14 Q