3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $output = array_slice(array_merge(explode(' | ', $input), array(null)), 0, 2); $output = array_slice(explode(" | ", "$input | "), 0, 2); $input = 'one'; print_r($output); $input = 'one | two'; print_r($output); $input = 'one | two | three'; print_r($output); $input = 'one | two | three | '; print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TTFn6
function name:  (null)
number of ops:  29
compiled vars:  !0 = $output, !1 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'array_slice'
          1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+%7C+'
          3        NOP                                                      
          4        FAST_CONCAT                                      ~2      !1, '+%7C+'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        SEND_VAL                                                 0
          9        SEND_VAL                                                 2
         10        DO_ICALL                                         $4      
         11        ASSIGN                                                   !0, $4
    8    12        ASSIGN                                                   !1, 'one'
    9    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   11    16        ASSIGN                                                   !1, 'one+%7C+two'
   12    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   14    20        ASSIGN                                                   !1, 'one+%7C+two+%7C+three'
   15    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   17    24        ASSIGN                                                   !1, 'one+%7C+two+%7C+three+%7C+'
   18    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.93 ms | 1400 KiB | 19 Q