3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Plop{ public function getURL($name){ return str_replace('%name%', $name, self::$URL); } } class Test{ use Plop; protected static $URL = '/plop/%name'; } echo Test::getURL('test');

preferences:
40.56 ms | 402 KiB | 5 Q