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.4.15 - 8.4.16, 8.5.1
UPPERCASEuppercase
Output for 8.3.5
Parse error: syntax error, unexpected token "=>" in /in/t80RS on line 6
Process exited with code 255.

preferences:
43.29 ms | 500 KiB | 3 Q