3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $foo = function () { $bar = (yield "foo"); var_dump($bar); }; $c = $foo(); while ($c->valid()) { var_dump($c->current()); $c->send("bar"); $c->next(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 6
Branch analysis from position: 19
Branch analysis from position: 6
filename:       /in/SEQ8a
function name:  (null)
number of ops:  20
compiled vars:  !0 = $foo, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FSEQ8a%3A4%240'
          1        ASSIGN                                                   !0, ~2
    9     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0  $4      
          4        ASSIGN                                                   !1, $4
   11     5      > JMP                                                      ->16
   12     6    >   INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'current'
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   13    11        INIT_METHOD_CALL                                         !1, 'send'
         12        SEND_VAL_EX                                              'bar'
         13        DO_FCALL                                      0          
   14    14        INIT_METHOD_CALL                                         !1, 'next'
         15        DO_FCALL                                      0          
   11    16    >   INIT_METHOD_CALL                                         !1, 'valid'
         17        DO_FCALL                                      0  $10     
         18      > JMPNZ                                                    $10, ->6
   15    19    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FSEQ8a%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/SEQ8a
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   GENERATOR_CREATE                                         
    5     1        YIELD                                            $1      'foo'
          2        ASSIGN                                                   !0, $1
    6     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    7     6      > GENERATOR_RETURN                                         

End of function %00%7Bclosure%7D%2Fin%2FSEQ8a%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.39 ms | 1396 KiB | 15 Q