3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types = 1); class Example1 { public string $foo = 'UPPERCASE' { set => strtolower($value); } } class Example2 { public function __construct( public string $foo = 'UPPERCASE' { set => strtolower($value); } ) { } } echo new Example1()->foo; echo new Example2()->foo;
Output for 8.3.5
Parse error: syntax error, unexpected token "=>" in /in/t80RS on line 6
Process exited with code 255.
Output for 8.4.15 - 8.4.26, 8.5.0 - 8.5.1
UPPERCASEuppercase

preferences:
33.09 ms | 1154 KiB | 7 Q