3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function __construct( public string $secret, public string $normal ) { //throw new Exception('Error!'); } } class Bar { function __construct( #[\SensitiveParameter] public string $secret, public string $normal ) { //throw new Exception('Error!'); } } try { $foo = new Foo('password', 'normal'); var_dump(serialize($foo)); } catch (Exception $e) { echo $e, PHP_EOL, PHP_EOL; } try { $bar = new Bar('password', 'normal'); var_dump(serialize($bar)); } catch (Exception $e) { echo $e, PHP_EOL, PHP_EOL; }

preferences:
23.55 ms | 404 KiB | 5 Q