3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IFace{ function do(); } class Foo implements IFace { function do() { return 'OK'; } } class Bar { $face = null; function __construct(IFace $f) { $this->face = $f; } } $bar = new Bar(new Foo());
Output for 5.4.0 - 5.4.19, 5.5.0 - 5.5.3
Parse error: syntax error, unexpected 'do' (T_DO), expecting identifier (T_STRING) in /in/vihFh on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_DO, expecting T_STRING in /in/vihFh on line 3
Process exited with code 255.

preferences:
174.16 ms | 1395 KiB | 59 Q