3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* function has_next($array) { return next($array) === false && key($array) === null ? false : true; } */ $array1 = [ "one" => 1, "two" => 2, "three" => 3, "four" => 4 ]; while (current($array1)!==false) { $current = current($array1); $key = key($array1); echo "$key => $current\n"; if ($current < 3) { $array1[$key] = ++$current; } else { next($array1); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 2
Branch analysis from position: 29
Branch analysis from position: 2
filename:       /in/RFTtL
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array1, !1 = $current, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
   14     1      > JMP                                                      ->24
   15     2    >   INIT_FCALL                                               'current'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   16     6        INIT_FCALL                                               'key'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   17    10        ROPE_INIT                                     4  ~9      !2
         11        ROPE_ADD                                      1  ~9      ~9, '+%3D%3E+'
         12        ROPE_ADD                                      2  ~9      ~9, !1
         13        ROPE_END                                      3  ~8      ~9, '%0A'
         14        ECHO                                                     ~8
   18    15        IS_SMALLER                                               !1, 3
         16      > JMPZ                                                     ~11, ->21
   19    17    >   PRE_INC                                          ~13     !1
         18        ASSIGN_DIM                                               !0, !2
         19        OP_DATA                                                  ~13
         20      > JMP                                                      ->24
   21    21    >   INIT_FCALL                                               'next'
         22        SEND_REF                                                 !0
         23        DO_ICALL                                                 
   14    24    >   INIT_FCALL                                               'current'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $15     
         27        TYPE_CHECK                                  1018          $15
         28      > JMPNZ                                                    ~16, ->2
   23    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1388 KiB | 19 Q