3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "Héllo Bob's and Russ’ new-found folks — goodbye"; var_export( array_reduce( preg_match_all("~([^\p{L}`'-]*)([\p{L}`'-]+)~u", $text, $m, PREG_SET_ORDER) ? $m : [], function($result, $m) { static $last = 0; $last += mb_strlen($m[1]); $result[] = [$m[2] => $last]; $last += mb_strlen($m[2]); return $result; }, [] ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'Héllo' => 0, ), 1 => array ( 'Bob\'s' => 6, ), 2 => array ( 'and' => 12, ), 3 => array ( 'Russ' => 16, ), 4 => array ( 'new-found' => 22, ), 5 => array ( 'folks' => 32, ), 6 => array ( 'goodbye' => 40, ), )

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:
28.16 ms | 406 KiB | 5 Q