3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "\tA\t B \tC \t D "; var_export( [ 'input' => $string, 'space, no flag' => preg_split('~ +~', $string), 'space, flag' => preg_split('~ +~', $string, -1, PREG_SPLIT_NO_EMPTY), 'tab, no flag' => preg_split('~\t+~', $string), 'tab, flag' => preg_split('~\t+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'whitespace, no flag' => preg_split('~\s+~', $string), 'whitespace, flag' => preg_split('~\s+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'tab&space, no flag' => preg_split('~[\t ]+~', $string), 'tab&space, flag' => preg_split('~[\t ]+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'horizontal whitespace, no flag' => preg_split('~\h+~', $string), 'horizontal whitespace, flag' => preg_split('~\h+~', $string, -1, PREG_SPLIT_NO_EMPTY), ] );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WSPDS
function name:  (null)
number of ops:  66
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%09A%09+B+%09C+%09+D+'
    5     1        INIT_FCALL                                               'var_export'
    7     2        INIT_ARRAY                                       ~2      !0, 'input'
    8     3        INIT_FCALL                                               'preg_split'
          4        SEND_VAL                                                 '%7E+%2B%7E'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ADD_ARRAY_ELEMENT                                ~2      $3, 'space%2C+no+flag'
    9     8        INIT_FCALL                                               'preg_split'
          9        SEND_VAL                                                 '%7E+%2B%7E'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 -1
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $4      
         14        ADD_ARRAY_ELEMENT                                ~2      $4, 'space%2C+flag'
   10    15        INIT_FCALL                                               'preg_split'
         16        SEND_VAL                                                 '%7E%5Ct%2B%7E'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $5      
         19        ADD_ARRAY_ELEMENT                                ~2      $5, 'tab%2C+no+flag'
   11    20        INIT_FCALL                                               'preg_split'
         21        SEND_VAL                                                 '%7E%5Ct%2B%7E'
         22        SEND_VAR                                                 !0
         23        SEND_VAL                                                 -1
         24        SEND_VAL                                                 1
         25        DO_ICALL                                         $6      
         26        ADD_ARRAY_ELEMENT                                ~2      $6, 'tab%2C+flag'
   12    27        INIT_FCALL                                               'preg_split'
         28        SEND_VAL                                                 '%7E%5Cs%2B%7E'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $7      
         31        ADD_ARRAY_ELEMENT                                ~2      $7, 'whitespace%2C+no+flag'
   13    32        INIT_FCALL                                               'preg_split'
         33        SEND_VAL                                                 '%7E%5Cs%2B%7E'
         34        SEND_VAR                                                 !0
         35        SEND_VAL                                                 -1
         36        SEND_VAL                                                 1
         37        DO_ICALL                                         $8      
         38        ADD_ARRAY_ELEMENT                                ~2      $8, 'whitespace%2C+flag'
   14    39        INIT_FCALL                                               'preg_split'
         40        SEND_VAL                                                 '%7E%5B%5Ct+%5D%2B%7E'
         41        SEND_VAR                                                 !0
         42        DO_ICALL                                         $9      
         43        ADD_ARRAY_ELEMENT                                ~2      $9, 'tab%26space%2C+no+flag'
   15    44        INIT_FCALL                                               'preg_split'
         45        SEND_VAL                                                 '%7E%5B%5Ct+%5D%2B%7E'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 -1
         48        SEND_VAL                                                 1
         49        DO_ICALL                                         $10     
         50        ADD_ARRAY_ELEMENT                                ~2      $10, 'tab%26space%2C+flag'
   16    51        INIT_FCALL                                               'preg_split'
         52        SEND_VAL                                                 '%7E%5Ch%2B%7E'
         53        SEND_VAR                                                 !0
         54        DO_ICALL                                         $11     
         55        ADD_ARRAY_ELEMENT                                ~2      $11, 'horizontal+whitespace%2C+no+flag'
   17    56        INIT_FCALL                                               'preg_split'
         57        SEND_VAL                                                 '%7E%5Ch%2B%7E'
         58        SEND_VAR                                                 !0
         59        SEND_VAL                                                 -1
         60        SEND_VAL                                                 1
         61        DO_ICALL                                         $12     
         62        ADD_ARRAY_ELEMENT                                ~2      $12, 'horizontal+whitespace%2C+flag'
         63        SEND_VAL                                                 ~2
    5    64        DO_ICALL                                                 
   19    65      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.55 ms | 1004 KiB | 15 Q