3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { static $data = array( array('site_name' => 'bar'), array(), array('site_name' => 'baz') ); $current = current($data); next($data); return $current; } while ($bar = foo()) echo $bar['site_name']."\n"; echo '-------------------------------------------'."\n"; while (($bar = foo()) !== false) echo $bar['site_name']."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 1
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
Branch analysis from position: 10
Branch analysis from position: 1
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 1
Branch analysis from position: 8
Branch analysis from position: 1
filename:       /in/21oB1
function name:  (null)
number of ops:  19
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > JMP                                                      ->4
          1    >   FETCH_DIM_R                                      ~1      !0, 'site_name'
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
          4    >   INIT_FCALL                                               'foo'
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                           ~4      !0, $3
          7      > JMPNZ                                                    ~4, ->1
   16     8    >   ECHO                                                     '-------------------------------------------%0A'
   17     9      > JMP                                                      ->13
         10    >   FETCH_DIM_R                                      ~5      !0, 'site_name'
         11        CONCAT                                           ~6      ~5, '%0A'
         12        ECHO                                                     ~6
         13    >   INIT_FCALL                                               'foo'
         14        DO_FCALL                                      0  $7      
         15        ASSIGN                                           ~8      !0, $7
         16        TYPE_CHECK                                  1018          ~8
         17      > JMPNZ                                                    ~9, ->10
         18    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/21oB1
function name:  foo
number of ops:  10
compiled vars:  !0 = $data, !1 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    9     1        INIT_FCALL                                               'current'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   10     5        INIT_FCALL                                               'next'
          6        SEND_REF                                                 !0
          7        DO_ICALL                                                 
   12     8      > RETURN                                                   !1
   13     9*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.68 ms | 1399 KiB | 19 Q