3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex = '/([A-Za-z])+(?:\s+\S+)/'; $vhost = ' DocumentRoot /www/example2 ServerName www.example.org ErrorLog /var/log/log.txt <Directory> ErrorLog /var/log/log.txt </Directory> <Directory /> ErrorLog /var/log/log.txt </Directory>'; preg_match_all($regex, $vhost, $matches); 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(2) { [0]=> array(6) { [0]=> string(26) "DocumentRoot /www/example2" [1]=> string(26) "ServerName www.example.org" [2]=> string(25) "ErrorLog /var/log/log.txt" [3]=> string(25) "ErrorLog /var/log/log.txt" [4]=> string(12) "Directory />" [5]=> string(25) "ErrorLog /var/log/log.txt" } [1]=> array(6) { [0]=> string(1) "t" [1]=> string(1) "e" [2]=> string(1) "g" [3]=> string(1) "g" [4]=> string(1) "y" [5]=> string(1) "g" } } Warning: Undefined variable $vHost in /in/Ov1qa on line 28 Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/Ov1qa on line 28 Fatal error: Uncaught Exception: No VHost Found in /in/Ov1qa:29 Stack trace: #0 {main} thrown in /in/Ov1qa on line 29
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:
41.73 ms | 402 KiB | 8 Q