3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/s+/'; $vhost = 'DocumentRoot /www/example2'; var_dump(preg_split($regex, $vhost)); //var_dump($matches); $vhostRegEx = '/<VirtualHost (\d{1,3}\.\d{1,3}.\d{1,3}.\d{1,3}):(\d+)>([\s\S]+)<\/VirtualHost>/'; $matches = []; if (!preg_match($vhostRegEx, $vHost, $matches)) { throw new \Exception("No VHost Found"); } var_dump($matches);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> string(26) "DocumentRoot /www/example2" } Warning: Undefined variable $vHost in /in/ZpSY4 on line 17 Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/ZpSY4 on line 17 Fatal error: Uncaught Exception: No VHost Found in /in/ZpSY4:18 Stack trace: #0 {main} thrown in /in/ZpSY4 on line 18
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:
45.08 ms | 401 KiB | 8 Q