3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class A{ public string $buffer; } class B extends A{ public int $buffer; }
Output for 8.2.10
Fatal error: Type of B::$buffer must be string (as in class A) in /in/rH5Ea on line 7
Process exited with code 255.
Output for 7.4.0 - 7.4.13, 8.0.0
Fatal error: Type of B::$buffer must be string (as in class A) in /in/rH5Ea on line 9
Process exited with code 255.
Output for 7.3.0 - 7.3.25
Parse error: syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/rH5Ea on line 4
Process exited with code 255.

preferences:
173.7 ms | 1395 KiB | 49 Q