3v4l.org

run code in 300+ PHP versions simultaneously
<?php $modules_flipped = array_flip(['aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff', 'ggg', 'hhh', 'iii', 'jjj']); $module = key($modules_flipped); print "$module -- begin\n"; // No unset, just next(). next($modules_flipped); $module = key($modules_flipped); print "$module -- after next()\n"; // next() + unset(). next($modules_flipped); unset($modules_flipped[$module]); $module = key($modules_flipped); print "$module -- after next() + unset()\n"; print "\nNotice that 'ddd' is being skipped!\n\n"; // unset() + next(). unset($modules_flipped[$module]); next($modules_flipped); $module = key($modules_flipped); print "$module -- after unset() + next()\n"; // unset(). unset($modules_flipped[$module]); $module = key($modules_flipped); print "$module -- after unset()\n"; // unset() + set. unset($modules_flipped[$module]); $modules_flipped[$module] = 0; $module = key($modules_flipped); print "$module -- after unset() + set\n"; print "\nNotice that 'ggg' is being repeated!\n\n"; // nothing. $module = key($modules_flipped); print "$module -- after nothing\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pLHWK
function name:  (null)
number of ops:  71
compiled vars:  !0 = $modules_flipped, !1 = $module
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_flip'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    5     4        INIT_FCALL                                               'key'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
    6     8        NOP                                                      
          9        FAST_CONCAT                                      ~6      !1, '+--+begin%0A'
         10        ECHO                                                     ~6
    9    11        INIT_FCALL                                               'next'
         12        SEND_REF                                                 !0
         13        DO_ICALL                                                 
   10    14        INIT_FCALL                                               'key'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        ASSIGN                                                   !1, $8
   11    18        NOP                                                      
         19        FAST_CONCAT                                      ~10     !1, '+--+after+next%28%29%0A'
         20        ECHO                                                     ~10
   14    21        INIT_FCALL                                               'next'
         22        SEND_REF                                                 !0
         23        DO_ICALL                                                 
   15    24        UNSET_DIM                                                !0, !1
   16    25        INIT_FCALL                                               'key'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $12     
         28        ASSIGN                                                   !1, $12
   17    29        NOP                                                      
         30        FAST_CONCAT                                      ~14     !1, '+--+after+next%28%29+%2B+unset%28%29%0A'
         31        ECHO                                                     ~14
   19    32        ECHO                                                     '%0ANotice+that+%27ddd%27+is+being+skipped%21%0A%0A'
   22    33        UNSET_DIM                                                !0, !1
   23    34        INIT_FCALL                                               'next'
         35        SEND_REF                                                 !0
         36        DO_ICALL                                                 
   24    37        INIT_FCALL                                               'key'
         38        SEND_VAR                                                 !0
         39        DO_ICALL                                         $16     
         40        ASSIGN                                                   !1, $16
   25    41        NOP                                                      
         42        FAST_CONCAT                                      ~18     !1, '+--+after+unset%28%29+%2B+next%28%29%0A'
         43        ECHO                                                     ~18
   28    44        UNSET_DIM                                                !0, !1
   29    45        INIT_FCALL                                               'key'
         46        SEND_VAR                                                 !0
         47        DO_ICALL                                         $19     
         48        ASSIGN                                                   !1, $19
   30    49        NOP                                                      
         50        FAST_CONCAT                                      ~21     !1, '+--+after+unset%28%29%0A'
         51        ECHO                                                     ~21
   33    52        UNSET_DIM                                                !0, !1
   34    53        ASSIGN_DIM                                               !0, !1
         54        OP_DATA                                                  0
   35    55        INIT_FCALL                                               'key'
         56        SEND_VAR                                                 !0
         57        DO_ICALL                                         $23     
         58        ASSIGN                                                   !1, $23
   36    59        NOP                                                      
         60        FAST_CONCAT                                      ~25     !1, '+--+after+unset%28%29+%2B+set%0A'
         61        ECHO                                                     ~25
   38    62        ECHO                                                     '%0ANotice+that+%27ggg%27+is+being+repeated%21%0A%0A'
   41    63        INIT_FCALL                                               'key'
         64        SEND_VAR                                                 !0
         65        DO_ICALL                                         $26     
         66        ASSIGN                                                   !1, $26
   42    67        NOP                                                      
         68        FAST_CONCAT                                      ~28     !1, '+--+after+nothing%0A'
         69        ECHO                                                     ~28
         70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.57 ms | 1007 KiB | 16 Q