3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Wow { public Typed $thing; public function __construct($thing) { $this->thing = $thing; } } var_dump(new Wow("not a sausage"));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
Fatal error: Uncaught TypeError: Cannot assign string to property Wow::$thing of type Typed in /in/MZ6TD:6 Stack trace: #0 /in/MZ6TD(10): Wow->__construct('not a sausage') #1 {main} thrown in /in/MZ6TD on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Typed property Wow::$thing must be an instance of Typed, string used in /in/MZ6TD:6 Stack trace: #0 /in/MZ6TD(10): Wow->__construct('not a sausage') #1 {main} thrown in /in/MZ6TD on line 6
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Parse error: syntax error, unexpected 'Typed' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /in/MZ6TD on line 3
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Parse error: syntax error, unexpected 'Typed' (T_STRING), expecting variable (T_VARIABLE) in /in/MZ6TD on line 3
Process exited with code 255.

preferences:
50.35 ms | 410 KiB | 5 Q