3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr[0]="page0"; $arr[1]="page1"; $arr[2]="page2"; $arr[3]="goal"; $arr[4]="page4"; echo implode(" ---> ", array_slice($arr, 0, array_search("goal",$arr)+1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cFhv3
function name:  (null)
number of ops:  26
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 0
          1        OP_DATA                                                  'page0'
    4     2        ASSIGN_DIM                                               !0, 1
          3        OP_DATA                                                  'page1'
    5     4        ASSIGN_DIM                                               !0, 2
          5        OP_DATA                                                  'page2'
    6     6        ASSIGN_DIM                                               !0, 3
          7        OP_DATA                                                  'goal'
    7     8        ASSIGN_DIM                                               !0, 4
          9        OP_DATA                                                  'page4'
   10    10        INIT_FCALL                                               'implode'
         11        SEND_VAL                                                 '+---%3E+'
         12        INIT_FCALL                                               'array_slice'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 0
         15        INIT_FCALL                                               'array_search'
         16        SEND_VAL                                                 'goal'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $6      
         19        ADD                                              ~7      $6, 1
         20        SEND_VAL                                                 ~7
         21        DO_ICALL                                         $8      
         22        SEND_VAR                                                 $8
         23        DO_ICALL                                         $9      
         24        ECHO                                                     $9
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.54 ms | 1438 KiB | 16 Q