3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = "Αυτή είναι η 1η δοκιμασία. Πρέπει να την ολοκληρώσω. Ώστε να μου δώσουν την 2η δοκιμασία. Και τέλος, την 3η δοκιμασία." ; $res = preg_split( "/(.*?\.*?)\../", $test, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE ); var_dump($res); $wordcounts = array_map(function ($item) { return count(preg_split('/\s+/', $item)); }, $res); var_dump($wordcounts);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in /in/JNBYX on line 4 array(4) { [0]=> string(45) "Αυτή είναι η 1η δοκιμασία" [1]=> string(45) "Πρέπει να την ολοκληρώσω" [2]=> string(63) "Ώστε να μου δώσουν την 2η δοκιμασία" [3]=> string(49) "Και τέλος, την 3η δοκιμασία." } array(4) { [0]=> int(5) [1]=> int(4) [2]=> int(7) [3]=> int(5) }

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:
18.22 ms | 402 KiB | 8 Q