3v4l.org

run code in 300+ PHP versions simultaneously
<?php class t{ private $t; public $value; public function __construct($test = 'test12'){ echo $this->t; $this->t = $test; } public functions __clone(){ echo 'clone'; } } $t = new t('tezd'); $t->value = 'clone?'; $t2 = new $t; var_dump($t, $t2);
Output for 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Parse error: syntax error, unexpected 'functions' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/iAPqJ on line 13
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected 'functions' (T_STRING), expecting variable (T_VARIABLE) in /in/iAPqJ on line 13
Process exited with code 255.

preferences:
171.5 ms | 1395 KiB | 44 Q