3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.45 ms | 1396 KiB | 19 Q