3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'FL'); while($current = current($a)) { if(next($a) == $current && next($a) == $current){ //staying put for next two legs echo $current; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
Branch analysis from position: 2
Branch analysis from position: 14
Branch analysis from position: 12
filename:       /in/8HJVY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > JMP                                                      ->14
    5     2    >   INIT_FCALL                                               'next'
          3        SEND_REF                                                 !0
          4        DO_ICALL                                         $3      
          5        IS_EQUAL                                         ~4      !1, $3
          6      > JMPZ_EX                                          ~4      ~4, ->12
          7    >   INIT_FCALL                                               'next'
          8        SEND_REF                                                 !0
          9        DO_ICALL                                         $5      
         10        IS_EQUAL                                         ~6      !1, $5
         11        BOOL                                             ~4      ~6
         12    > > JMPZ                                                     ~4, ->14
    7    13    >   ECHO                                                     !1
    4    14    >   INIT_FCALL                                               'current'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $7      
         17        ASSIGN                                           ~8      !1, $7
         18      > JMPNZ                                                    ~8, ->2
    9    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.29 ms | 1395 KiB | 17 Q