3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.74 ms | 1400 KiB | 17 Q