3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1 => '5ive', 'jim' => 'bob', 4 => 5); echo current($array) . "\n"; var_dump($array); echo "\n"; var_dump(array_slice($array, 0, 1)); echo 'first item: ' . array_slice($array, 0, 1)[0] . "\n"; echo current($array) . "\n"; var_dump($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z3alF
function name:  (null)
number of ops:  36
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'current'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      $2, '%0A'
          5        ECHO                                                     ~3
    6     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    8     9        ECHO                                                     '%0A'
   10    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'array_slice'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 0
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $5      
         16        SEND_VAR                                                 $5
         17        DO_ICALL                                                 
   12    18        INIT_FCALL                                               'array_slice'
         19        SEND_VAR                                                 !0
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 1
         22        DO_ICALL                                         $7      
         23        FETCH_DIM_R                                      ~8      $7, 0
         24        CONCAT                                           ~9      'first+item%3A+', ~8
         25        CONCAT                                           ~10     ~9, '%0A'
         26        ECHO                                                     ~10
   14    27        INIT_FCALL                                               'current'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $11     
         30        CONCAT                                           ~12     $11, '%0A'
         31        ECHO                                                     ~12
   15    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.39 ms | 1396 KiB | 19 Q