3v4l.org

run code in 300+ 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

preferences:
148.8 ms | 1100 KiB | 6 Q