3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = 'one'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two | three'; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output); $input = 'one | two | three | '; $output = array_slice(explode(" | ", "$input | "), 0, 2); print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gl0dq
function name:  (null)
number of ops:  65
compiled vars:  !0 = $input, !1 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'one'
    4     1        INIT_FCALL                                               'array_slice'
          2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '+%7C+'
          4        NOP                                                      
          5        FAST_CONCAT                                      ~3      !0, '+%7C+'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 2
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
    5    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    7    16        ASSIGN                                                   !0, 'one+%7C+two'
    8    17        INIT_FCALL                                               'array_slice'
         18        INIT_FCALL                                               'explode'
         19        SEND_VAL                                                 '+%7C+'
         20        NOP                                                      
         21        FAST_CONCAT                                      ~9      !0, '+%7C+'
         22        SEND_VAL                                                 ~9
         23        DO_ICALL                                         $10     
         24        SEND_VAR                                                 $10
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 2
         27        DO_ICALL                                         $11     
         28        ASSIGN                                                   !1, $11
    9    29        INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                                 
   11    32        ASSIGN                                                   !0, 'one+%7C+two+%7C+three'
   12    33        INIT_FCALL                                               'array_slice'
         34        INIT_FCALL                                               'explode'
         35        SEND_VAL                                                 '+%7C+'
         36        NOP                                                      
         37        FAST_CONCAT                                      ~15     !0, '+%7C+'
         38        SEND_VAL                                                 ~15
         39        DO_ICALL                                         $16     
         40        SEND_VAR                                                 $16
         41        SEND_VAL                                                 0
         42        SEND_VAL                                                 2
         43        DO_ICALL                                         $17     
         44        ASSIGN                                                   !1, $17
   13    45        INIT_FCALL                                               'print_r'
         46        SEND_VAR                                                 !1
         47        DO_ICALL                                                 
   15    48        ASSIGN                                                   !0, 'one+%7C+two+%7C+three+%7C+'
   16    49        INIT_FCALL                                               'array_slice'
         50        INIT_FCALL                                               'explode'
         51        SEND_VAL                                                 '+%7C+'
         52        NOP                                                      
         53        FAST_CONCAT                                      ~21     !0, '+%7C+'
         54        SEND_VAL                                                 ~21
         55        DO_ICALL                                         $22     
         56        SEND_VAR                                                 $22
         57        SEND_VAL                                                 0
         58        SEND_VAL                                                 2
         59        DO_ICALL                                         $23     
         60        ASSIGN                                                   !1, $23
   17    61        INIT_FCALL                                               'print_r'
         62        SEND_VAR                                                 !1
         63        DO_ICALL                                                 
         64      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.08 ms | 1400 KiB | 19 Q