3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = "11:12:12:test titel 1\n 12:13:13:test titel 2\n 13:14:14:test titel 3"; $arr = preg_split("/(:|\n)/" ,$content); var_dump($arr);
Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
array(14) { [0]=> string(2) "11" [1]=> string(2) "12" [2]=> string(2) "12" [3]=> string(12) "test titel 1" [4]=> string(0) "" [5]=> string(14) " 12" [6]=> string(2) "13" [7]=> string(2) "13" [8]=> string(12) "test titel 2" [9]=> string(0) "" [10]=> string(14) " 13" [11]=> string(2) "14" [12]=> string(2) "14" [13]=> string(12) "test titel 3" }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(14) { [0]=> string(2) "11" [1]=> string(2) "12" [2]=> string(2) "12" [3]=> string(12) "test titel 1" [4]=> string(0) "" [5]=> string(14) " 12" [6]=> string(2) "13" [7]=> string(2) "13" [8]=> string(12) "test titel 2" [9]=> string(0) "" [10]=> string(14) " 13" [11]=> string(2) "14" [12]=> string(2) "14" [13]=> string(12) "test titel 3" }

preferences:
218.81 ms | 403 KiB | 232 Q