3v4l.org

run code in 300+ PHP versions simultaneously
<?php $delim = ","; $items =2; $text = "oh my god, thank you the lot of downvotes, geniuses *.*"; $whatiwant = implode($delim, array_slice(explode($delim, $text),0,$items)); Echo $whatiwant;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KNSC4
function name:  (null)
number of ops:  19
compiled vars:  !0 = $delim, !1 = $items, !2 = $text, !3 = $whatiwant
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2C'
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, 'oh+my+god%2C+thank+you+the+lot+of+downvotes%2C+geniuses+%2A.%2A'
    6     3        INIT_FCALL                                               'implode'
          4        SEND_VAR                                                 !0
          5        INIT_FCALL                                               'array_slice'
          6        INIT_FCALL                                               'explode'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        SEND_VAL                                                 0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        SEND_VAR                                                 $8
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !3, $9
    7    17        ECHO                                                     !3
    8    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.46 ms | 1006 KiB | 16 Q