3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\d{5}/'; $str = '5900062000'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result var_dump($matches); foreach($matches as $match){ echo(substr($match,0,2)); }
Output for git.master_jit, git.master, rfc.property-hooks
array(2) { [0]=> array(1) { [0]=> string(5) "59000" } [1]=> array(1) { [0]=> string(5) "62000" } } Fatal error: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /in/QkATN:12 Stack trace: #0 /in/QkATN(12): substr(Array, 0, 2) #1 {main} thrown in /in/QkATN on line 12
Process exited with code 255.

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