3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $vhost =' <Directory "/srv/httpd/htdocs/mydomain.com"> Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx Allow from xxx.xxx.xxx.xxx Deny from all </Directory> <Directory "/srv/httpd/htdocs/myseconddomain"> Options Indexes FollowSymLinks AllowOverride All Order deny,allow Allow from 127.0.0.1 Allow from xxx.xxx.xxx.xxx Allow from xxx.xxx.xxx.xxx Deny from all </Directory> '; $matches = []; $directory = preg_match_all('/<Directory "(.*")>([\s\S]*?)<\/Directory>/', $vhost, $matches, PREG_SET_ORDER); foreach ($matches as $match) { echo "Directory: " . $match[1] . "\n" } var_dump($matches);
based on 01NYL
Output for 5.4.0 - 5.4.32
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/YmDs9 on line 30
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/YmDs9 on line 25
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/YmDs9 on line 25
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/YmDs9 on line 25
Process exited with code 255.