3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh type RETTYPE<T> = shape('t' => demo<T>, 'z' => demo<Z>); class demoStart<T, Z> { const RET = RETTYPE<T, Z>; } class demo<T> { const RET = T; } type test = shape('demo' => demoStart<int>{1,2}::RET); echo test; //type Point<T> = shape ('x' => T, 'y' => T);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'type' (T_STRING) in /in/BV1i9 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.29
<?hh type RETTYPE<T> = shape('t' => demo<T>, 'z' => demo<Z>); class demoStart<T, Z> { const RET = RETTYPE<T, Z>; } class demo<T> { const RET = T; } type test = shape('demo' => demoStart<int>{1,2}::RET); echo test; //type Point<T> = shape ('x' => T, 'y' => T);