3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'A number at the end 1357', '2368 Letters and spaces 8675309', ]; foreach ($strings as $string) { var_export([ 'strcspn' => strcspn($string, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '), //reduces to 'a..zA..Z ' 'strspn' => strspn($string, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '), //reduces to 'a..zA..Z ' 'strpbrk' => strpbrk($string, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '), //reduces to 'a..zA..Z ' 'strtok' => strtok($string, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '), //reduces to 'a..zA..Z ' 'strtok2' => strtok('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '), //reduces to 'a..zA..Z ' ]); echo "\n--\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'strcspn' => 0, 'strspn' => 20, 'strpbrk' => 'A number at the end 1357', 'strtok' => '1357', 'strtok2' => false, ) -- array ( 'strcspn' => 4, 'strspn' => 0, 'strpbrk' => ' Letters and spaces 8675309', 'strtok' => '2368', 'strtok2' => '8675309', ) --

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