3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<TEXT ~THE BURGER ZERO~ No burger, no bun, just air. ~TRICKY TEST~ Meet me ~5pm. ~THE BURGER ITALIANO~ A soft mix of ground beef & mozzarella stuffed between two pillowy pieces of pasta.~NOTE~This is basically giant ravioli. ~THE BURGER MINI~A tiny little burger patty in a tiny little bun. TEXT; $pattern = '/ \s* ~ ( [\p{Lu} ]+ ) ~ \s* /ux'; $arr = preg_split($pattern, $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); print_r(array_chunk($arr, 2));
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [0] => Array ( [0] => THE BURGER ZERO [1] => No burger, no bun, just air. ) [1] => Array ( [0] => TRICKY TEST [1] => Meet me ~5pm. ) [2] => Array ( [0] => THE BURGER ITALIANO [1] => A soft mix of ground beef & mozzarella stuffed between two pillowy pieces of pasta. ) [3] => Array ( [0] => NOTE [1] => This is basically giant ravioli. ) [4] => Array ( [0] => THE BURGER MINI [1] => A tiny little burger patty in a tiny little bun. ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
56.57 ms | 407 KiB | 5 Q