3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stepIds = ['foo', 'bar', 'baz', 'tab']; $stepId = 'foo'; $r = array_slice($stepIds, array_search($stepId, $stepIds, true)); var_dump($r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g5jl1
function name:  (null)
number of ops:  16
compiled vars:  !0 = $stepIds, !1 = $stepId, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'foo'
    6     2        INIT_FCALL                                               'array_slice'
          3        SEND_VAR                                                 !0
          4        INIT_FCALL                                               'array_search'
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 <true>
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    8    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.23 ms | 1394 KiB | 19 Q