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/2ENUY
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $next, !2 = $current
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1      > JMP                                                      ->14
    5     2    >   INIT_DYNAMIC_CALL                                        !1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $4      
          5        IS_EQUAL                                         ~5      !2, $4
          6      > JMPZ_EX                                          ~5      ~5, ->12
          7    >   INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $6      
         10        IS_EQUAL                                         ~7      !2, $6
         11        BOOL                                             ~5      ~7
         12    > > JMPZ                                                     ~5, ->14
    7    13    >   ECHO                                                     !2
    4    14    >   INIT_FCALL                                               'current'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        ASSIGN                                           ~9      !2, $8
         18      > JMPNZ                                                    ~9, ->2
    9    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.81 ms | 940 KiB | 16 Q