3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $foo; function __construct($foo) { $this->foo = $foo; } } class B_okay extends A { private $bar; function __construct($foo) { parent::__construct($foo); $this->bar = false; } } class B_error extends A { private $bar; function __construct($foo) { $this->bar = false; } }
Output for 5.2.0, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Output for 4.3.5
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/sfQru on line 5
Process exited with code 255.

preferences:
135.7 ms | 401 KiB | 123 Q