3v4l.org

run code in 300+ PHP versions simultaneously
<?php //I want the 'delimX' to be included as well: $str = "It seems entirely 1 (b natural b) to us that there are teams of scientists in universities and other institutions around the world, attempting to 2 (b discover b) the way the world works. However, it hasn't always been that 3 (b way b) . Although the scientific method is now four or five hundred years old, the ancient Greeks, for example, believed that they could work out the 4 (b causes b) of natural events just by the power of thought."; $result = preg_split ('~(\(b.*?b\))~',$str ,-1, PREG_SPLIT_DELIM_CAPTURE); var_dump($result);
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.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(9) { [0]=> string(20) "It seems entirely 1 " [1]=> string(13) "(b natural b)" [2]=> string(115) " to us that there are teams of scientists in universities and other institutions around the world, attempting to 2 " [3]=> string(14) "(b discover b)" [4]=> string(64) " the way the world works. However, it hasn't always been that 3 " [5]=> string(9) "(b way b)" [6]=> string(146) " . Although the scientific method is now four or five hundred years old, the ancient Greeks, for example, believed that they could work out the 4 " [7]=> string(12) "(b causes b)" [8]=> string(48) " of natural events just by the power of thought." }
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(9) { [0]=> string(20) "It seems entirely 1 " [1]=> string(13) "(b natural b)" [2]=> string(115) " to us that there are teams of scientists in universities and other institutions around the world, attempting to 2 " [3]=> string(14) "(b discover b)" [4]=> string(64) " the way the world works. However, it hasn't always been that 3 " [5]=> string(9) "(b way b)" [6]=> string(146) " . Although the scientific method is now four or five hundred years old, the ancient Greeks, for example, believed that they could work out the 4 " [7]=> string(12) "(b causes b)" [8]=> string(48) " of natural events just by the power of thought." }

preferences:
256.6 ms | 403 KiB | 288 Q