3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A { class T {} } namespace { class Test { public function first(string $str) : Closure { /* closure with return type declaration and use() clause */ $tmp = function() use ($str) : int { return strlen($str); }; return $tmp; } public function second() : self { return $this; } } class SubTest extends Test { public function third() : parent { return $this; } /* returning a namespace-qualified type */ public function fourth() : \A\T { return new \A\T; } /* spaces are allowed around elements of the namespace */ public function fifth() : \ A \ T { return $this->fifth(); } } $s = new SubTest; $t = $s->third(); var_dump(($t->second()->first("hello"))()); var_dump($s->fourth()); var_dump($s->fifth()); }

This is an error 404

There are `0` results


preferences:
156.88 ms | 1390 KiB | 7 Q