3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class version_info { private $vi; // Version Information Array function __construct() { $this->vi = array(); } function add($name, $filename, $doc = 0, $date, $ver) { $this->vi[$filename] = array( 'name' => $name, 'filename' => $filename, 'document' => $doc, // Include in automatic SiteCommander tech documentation 'version' => $ver, 'date' => $date ); } function dump() { // temporary for debugging print_r($this->vi); } } /* end of class version_info */ $sc_version_info = new version_info(); $sc_version_info->add('Test', '/admin/test.php', 1, 2, 3); $sc_version_info->dump();
Output for 5.0.0 - 7.1.0
Array ( [/admin/test.php] => Array ( [name] => Test [filename] => /admin/test.php [document] => 1 [version] => 3 [date] => 2 ) )
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/rr0cC on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/rr0cC on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/rr0cC on line 3
Process exited with code 255.