3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class db { public $default; function __construct() { $this->default = array( 'host' => 'host s;pace', 'database' => 'd', 'login' => 'l'); } } $db = new db(); $p = 'password'; $str = <<<EODT DB_HOST="{$db->default['host']}" DB_NAME="{$db->default['database']}" DB_USER="{$db->default['login']}" DB_PASS={$p} EODT; echo $str;
Output for 5.0.0 - 7.1.0
DB_HOST="host s;pace" DB_NAME="d" DB_USER="l" DB_PASS=password
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/4SlcE 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/4SlcE 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/4SlcE on line 3
Process exited with code 255.