3v4l.org

run code in 500+ PHP versions simultaneously
<?php $sentence = 'hypertext language, programming'; $keywords = preg_split('/[\s,]+/', $sentence); // ['hypertext', 'language', 'programming'] $separators = preg_split('/([\s,]+)/', $sentence, flags: PREG_SPLIT_DELIM_CAPTURE); // ['hypertext', ' ', 'language', ', ', 'programming'] $separator2s = preg_split('/([\s,])([\s]*)/', $sentence, flags: PREG_SPLIT_DELIM_CAPTURE); // ['hypertext', ' ', '', 'language', ',', ' ', 'programming'] $words = explode(' ', $sentence); // ['hypertext', 'language,', 'programming'] // comma is still collected ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/32S4H
function name:  (null)
number of ops:  26
compiled vars:  !0 = $sentence, !1 = $keywords, !2 = $separators, !3 = $separator2s, !4 = $words
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'hypertext+language%2C+programming'
    5     1        INIT_FCALL                                                   'preg_split'
          2        SEND_VAL                                                     '%2F%5B%5Cs%2C%5D%2B%2F'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    8     6        INIT_FCALL                                                   'preg_split'
          7        SEND_VAL                                                     '%2F%28%5B%5Cs%2C%5D%2B%29%2F'
          8        SEND_VAR                                                     !0
          9        SEND_VAL                                                     2
         10        CHECK_UNDEF_ARGS                                             
         11        DO_ICALL                                             $8      
         12        ASSIGN                                                       !2, $8
   11    13        INIT_FCALL                                                   'preg_split'
         14        SEND_VAL                                                     '%2F%28%5B%5Cs%2C%5D%29%28%5B%5Cs%5D%2A%29%2F'
         15        SEND_VAR                                                     !0
         16        SEND_VAL                                                     2
         17        CHECK_UNDEF_ARGS                                             
         18        DO_ICALL                                             $10     
         19        ASSIGN                                                       !3, $10
   14    20        INIT_FCALL                                                   'explode'
         21        SEND_VAL                                                     '+'
         22        SEND_VAR                                                     !0
         23        DO_ICALL                                             $12     
         24        ASSIGN                                                       !4, $12
   18    25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.4 ms | 1155 KiB | 15 Q