3v4l.org

run code in 300+ PHP versions simultaneously
<?php function splitIntoWords(string $strText, string $strLocale) { $iterator = \IntlBreakIterator::createWordInstance($strLocale); $iterator->setText($strText); $words = array(); foreach ($iterator->getPartsIterator() as $part) { if ($iterator->getRuleStatus() !== \IntlBreakIterator::WORD_NONE) { $words[] = $part; } } return $words; } var_dump(splitIntoWords('Foö bar baz', 'de'));
Output for git.master_jit, git.master, rfc.property-hooks
array(3) { [0]=> string(4) "Foö" [1]=> string(3) "bar" [2]=> string(3) "baz" }

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:
55.92 ms | 401 KiB | 8 Q