3v4l.org

run code in 500+ PHP versions simultaneously
<?php class PromoteConstructorProperty { public function __construct( public string $var ) { } } $bool = class_exists(PromoteConstructorProperty::class);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.33, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in /in/4cMW4 on line 6
Process exited with code 255.

preferences:
79.08 ms | 1440 KiB | 4 Q