3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dsn = 'git+http://github.com/phpDocumentor/phpDocumentor2;branch=develop'; $dsnParts = implode(';', $dsn); $location = $dsnParts[0]; unset($dsnParts[0]); $locationParts = parse_url($location); $options = array(); foreach($dsnParts as $part) { $option = explode('=', $part); $options[$option[0]] = $option[1]; } var_dump($locationParts); var_dump($options);
Output for 5.2.5 - 7.2.0
Warning: implode(): Invalid arguments passed in /in/Rj3Br on line 4 Warning: Invalid argument supplied for foreach() in /in/Rj3Br on line 9 array(1) { ["path"]=> string(0) "" } array(0) { }
Output for 4.3.2 - 4.3.10, 4.4.0 - 5.2.4
Warning: implode(): Bad arguments. in /in/Rj3Br on line 4 Warning: Invalid argument supplied for foreach() in /in/Rj3Br on line 9 array(1) { ["path"]=> string(0) "" } array(0) { }
Output for 4.3.11
Warning: implode(): Bad arguments. in /in/Rj3Br on line 4 array(1) { ["path"]=> string(0) "" } array(0) { }
Output for 4.3.0 - 4.3.1
Warning: implode() [http://www.php.net/function.implode]: Bad arguments. in /in/Rj3Br on line 4 Warning: Invalid argument supplied for foreach() in /in/Rj3Br on line 9 array(1) { ["path"]=> string(0) "" } array(0) { }