3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = "Apakah ada cara yang lebih cepat untuk mendapat 10 kata pertama selain cara di bawah."; print_r(preg_split('~(?<=\s)\s~', $text, -1, PREG_SPLIT_NO_EMPTY));
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined variable $text in /in/K1SEQ on line 4 Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/K1SEQ on line 4 Array ( )
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $text in /in/K1SEQ on line 4 Array ( )
Output for 5.6.38, 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: text in /in/K1SEQ on line 4 Array ( )
Output for 7.3.32 - 7.3.33
Array ( )

preferences:
191.2 ms | 401 KiB | 176 Q