3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10'; $times = 4; [$string1, $string2] = preg_split("/(?:[^,]+,? ?){0,$times}\K/", $str, 2); var_dump($string1, $string2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HUNIn
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str, !1 = $times, !2 = $string1, !3 = $string2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'temp1%2C+temp2%2C+temp3%2C+temp4%2C+temp5%2C+temp6%2C+temp7%2C+temp8%2C+temp9%2C+temp10'
    4     1        ASSIGN                                                   !1, 4
    6     2        INIT_FCALL                                               'preg_split'
          3        ROPE_INIT                                     3  ~7      '%2F%28%3F%3A%5B%5E%2C%5D%2B%2C%3F+%3F%29%7B0%2C'
          4        ROPE_ADD                                      1  ~7      ~7, !1
          5        ROPE_END                                      2  ~6      ~7, '%7D%5CK%2F'
          6        SEND_VAL                                                 ~6
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $9      
         10        FETCH_LIST_R                                     $10     $9, 0
         11        ASSIGN                                                   !2, $10
         12        FETCH_LIST_R                                     $12     $9, 1
         13        ASSIGN                                                   !3, $12
         14        FREE                                                     $9
    8    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.03 ms | 945 KiB | 18 Q