3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "It's just me, myself, i and an empty glass of wine. Age = 21"; $split = preg_split('/(,)\s|\s/', $string, -1, PREG_SPLIT_DELIM_CAPTURE); print_r($split);
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Array ( [0] => It's [1] => just [2] => me [3] => , [4] => myself [5] => , [6] => i [7] => and [8] => an [9] => empty [10] => glass [11] => of [12] => wine. [13] => Age [14] => = [15] => 21 )

preferences:
109.8 ms | 409 KiB | 5 Q