3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('FIELD_NAME',"foo"); class A { public $foo = 'foo'; } $a = new A(); echo $a->{FIELD_NAME};

preferences:
81.78 ms | 404 KiB | 5 Q