3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = ['ka' => 'va', 'kb' => 'vb', 'kc' => 'vc']; $part = array_slice($arr, 1, 1, true); $key = key($part); $value = current($part); var_dump($arr, $part, $key, $value);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mib99
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $part, !2 = $key, !3 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        INIT_FCALL                                                   'array_slice'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        SEND_VAL                                                     1
          5        SEND_VAL                                                     <true>
          6        DO_ICALL                                             $5      
          7        ASSIGN                                                       !1, $5
    5     8        INIT_FCALL                                                   'key'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $7      
         11        ASSIGN                                                       !2, $7
    6    12        INIT_FCALL                                                   'current'
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                             $9      
         15        ASSIGN                                                       !3, $9
    7    16        INIT_FCALL                                                   'var_dump'
         17        SEND_VAR                                                     !0
         18        SEND_VAR                                                     !1
         19        SEND_VAR                                                     !2
         20        SEND_VAR                                                     !3
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.3 ms | 2576 KiB | 17 Q