3v4l.org

run code in 500+ PHP versions simultaneously
<?php $longString = 'I like apple. You like oranges. We like fruit. I like meat, also.'; $maxLength = 18; var_export( preg_split("/.{0,{$maxLength}}\K(\s+|$)/", $longString, 0, PREG_SPLIT_NO_EMPTY) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oovpq
function name:  (null)
number of ops:  15
compiled vars:  !0 = $longString, !1 = $maxLength
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'I+like+apple.+You+like+oranges.+We+like+fruit.+I+like+meat%2C+also.'
    4     1        ASSIGN                                                       !1, 18
    6     2        INIT_FCALL                                                   'var_export'
    7     3        INIT_FCALL                                                   'preg_split'
          4        ROPE_INIT                                         3  ~5      '%2F.%7B0%2C'
          5        ROPE_ADD                                          1  ~5      ~5, !1
          6        ROPE_END                                          2  ~4      ~5, '%7D%5CK%28%5Cs%2B%7C%24%29%2F'
          7        SEND_VAL                                                     ~4
          8        SEND_VAR                                                     !0
          9        SEND_VAL                                                     0
         10        SEND_VAL                                                     1
         11        DO_ICALL                                             $7      
         12        SEND_VAR                                                     $7
    6    13        DO_ICALL                                                     
    8    14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
143.96 ms | 2170 KiB | 15 Q