3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ ')(8234@#$ABCFG3478&* hello', // mix '456456', // numeric 'ghijkl', // alphabetic '!@#$%^&*(', // non-alphanumeric ]; foreach ($strings as $string) { var_export( [ 'string' => $string, 'firstAlphaNumeric1' => preg_match('/[a-z0-9]/i', $string, $match) ? $match[0] : null, 'firstAlphaNumeric2' => $string[strcspn($string, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')] ?? null, 'firstAlphaNumeric3' => $string[strcspn($string, 'A..Zabcdefghijklmnopqrstuvwxyz0123456789')] ?? null, ] ); echo "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
array ( 'string' => ')(8234@#$ABCFG3478&* hello', 'firstAlphaNumeric1' => '8', 'firstAlphaNumeric2' => '8', 'firstAlphaNumeric3' => '8', ) array ( 'string' => '456456', 'firstAlphaNumeric1' => '4', 'firstAlphaNumeric2' => '4', 'firstAlphaNumeric3' => '4', ) array ( 'string' => 'ghijkl', 'firstAlphaNumeric1' => 'g', 'firstAlphaNumeric2' => 'g', 'firstAlphaNumeric3' => 'g', ) array ( 'string' => '!@#$%^&*(', 'firstAlphaNumeric1' => NULL, 'firstAlphaNumeric2' => NULL, 'firstAlphaNumeric3' => NULL, )

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:
47.36 ms | 1469 KiB | 4 Q