3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 1 => 'admin', '5d1acff7-51f5-d10a-8807-5ce3a25f3f01' => 'atul', '9324e078-e651-09ab-856c-5d00cf1d6302' => 'tushar', '3e4d9711-e4e0-f9de-8d40-5d021f3137fb' => 'praful', 'b283b589-c527-389f-498b-5cf0ea2338e1' => 'suraj' ]; $values = array_values($array); $offset = array_search('atul', $values); if ($offset !== false && isset($values[++$offset])) { var_export(array_slice($array, $offset, 1, true)); } else { echo "not found or no next"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 26
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/AHOek
function name:  (null)
number of ops:  28
compiled vars:  !0 = $array, !1 = $values, !2 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'array_values'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   12     5        INIT_FCALL                                               'array_search'
          6        SEND_VAL                                                 'atul'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !2, $6
   14    10        TYPE_CHECK                                  1018  ~8      !2
         11      > JMPZ_EX                                          ~8      ~8, ->15
         12    >   PRE_INC                                          ~9      !2
         13        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     !1, ~9
         14        BOOL                                             ~8      ~10
         15    > > JMPZ                                                     ~8, ->26
   15    16    >   INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'array_slice'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !2
         20        SEND_VAL                                                 1
         21        SEND_VAL                                                 <true>
         22        DO_ICALL                                         $11     
         23        SEND_VAR                                                 $11
         24        DO_ICALL                                                 
         25      > JMP                                                      ->27
   17    26    >   ECHO                                                     'not+found+or+no+next'
   18    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.58 ms | 1396 KiB | 21 Q