3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.92 ms | 1395 KiB | 19 Q