3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f() { $key = 1; $value = 1; $data = yield $value; //PHP Parse error: syntax error, unexpected '$value' (T_VARIABLE) in $data = yield $key => $value; //PHP Parse error: syntax error, unexpected '$key' (T_VARIABLE) in array(yield $key => $value); //PHP Parse error: syntax error, unexpected '$key' (T_VARIABLE), expecting ')' } $gen = f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dCOhe
function name:  (null)
number of ops:  4
compiled vars:  !0 = $gen
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'f'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/dCOhe
function name:  f
number of ops:  11
compiled vars:  !0 = $key, !1 = $value, !2 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    5     1        ASSIGN                                                   !0, 1
    6     2        ASSIGN                                                   !1, 1
    7     3        YIELD                                            $5      !1
          4        ASSIGN                                                   !2, $5
    8     5        YIELD                                            $7      !1, !0
          6        ASSIGN                                                   !2, $7
    9     7        YIELD                                            $9      !1, !0
          8        INIT_ARRAY                                       ~10     $9
          9        FREE                                                     ~10
   10    10      > GENERATOR_RETURN                                         

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.42 ms | 1397 KiB | 14 Q