3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users_emails = array('a' => 'Spence', 'b' => 'Matt', 'c' => 'Marc', 'd' => 'Adam', 'e' => 'Paul'); $keys = array_values(array_keys($users_emails)); $current = 'Matt'; $ordinal = array_search($current,$users_emails); $nextkey = (array_search($ordinal, $keys)+1); $next = $users_emails[$keys[$nextkey]]; echo $next;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iVO6U
function name:  (null)
number of ops:  25
compiled vars:  !0 = $users_emails, !1 = $keys, !2 = $current, !3 = $ordinal, !4 = $nextkey, !5 = $next
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_values'
          2        INIT_FCALL                                               'array_keys'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        SEND_VAR                                                 $7
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !1, $8
    6     8        ASSIGN                                                   !2, 'Matt'
    7     9        INIT_FCALL                                               'array_search'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !3, $11
    8    14        INIT_FCALL                                               'array_search'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $13     
         18        ADD                                              ~14     $13, 1
         19        ASSIGN                                                   !4, ~14
    9    20        FETCH_DIM_R                                      ~16     !1, !4
         21        FETCH_DIM_R                                      ~17     !0, ~16
         22        ASSIGN                                                   !5, ~17
   10    23        ECHO                                                     !5
   11    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.71 ms | 1012 KiB | 16 Q