3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace Foo\Bar; function date($format, $timestamp = null) { if ($format == 'Y') { return '2010'; } throw new \Exception("Only Y format is supported"); } echo date('Y');

preferences:
69.78 ms | 1425 KiB | 5 Q