3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Pont { $var function __construct($x){ $this->var = $x; } } $towerBridge = new Pont; $towerBridge->__construct(12.2, 43.1);
Output for 8.0.1 - 8.0.14, 8.1.0 - 8.1.1
Parse error: syntax error, unexpected variable "$var", expecting "function" or "const" in /in/PqCsT on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.27
Parse error: syntax error, unexpected '$var' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST) in /in/PqCsT on line 5
Process exited with code 255.

preferences:
168.57 ms | 1004 KiB | 7 Q