3v4l.org

run code in 300+ PHP versions simultaneously
<?php class thing{ public function __construct(){ $this->scripts = array( "js" => array(), "css" => array() ); } public function grab_scripts(){ foreach($this->scripts['js'] as $path){ echo '<script type="text/javascript" src="' . $path . '></script>'; } foreach($this->scripts['css'] as $path){ echo '<link type="text/css" rel="stylesheet" href="' . $path . '"/>'; } } $thing = new thing(); $thing->grab_scripts();
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '$thing' (T_VARIABLE), expecting function (T_FUNCTION) in /in/MrDMI on line 27
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/MrDMI on line 27
Process exited with code 255.

preferences:
180.03 ms | 1399 KiB | 66 Q