3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface IRouteBuilder { public function __construct($culture, $brand, $country); public function getRoute(sfWebRequest $request); } abstract class AbstractRouteBuilder implements IRouteBuilder { protected $culture; protected $brand; protected $country; public function __construct($culture, $brand, $country) { $this->culture = $culture; $this->brand = $brand; $this->country = $country; echo 'toto'; } abstract public function getRoute(sfWebRequest $request); protected function assertMandatoryParameters(array $parameters, sfWebRequest $request) { foreach ($parameters as $parameter) { if (is_null($request->getGetParameter($parameter))) { throw new Exception(sprintf('Missing parameter "%s"', $parameter)); } } } protected function generateUrl($route, $params) { return sfContext::getInstance()->getRouting()->generate($route, $params, true); } } class FrmTopicRouteBuilder extends AbstractRouteBuilder { implements public function getRoute(sfWebRequest $request) { $this->assertMandatoryParameters(array('id', 'title'), $request); $id = $request->getGetParameter('id'); $title = urldecode($request->getGetParameter('title')); $slug = StringSegment::slugify($title); return $this->generateUrl('frm_topic', array('id' => $id, 'slug' => $slug)); } } new FrmTopicRouteBuilder('fr', 'tha', 'FR');
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'implements' (T_IMPLEMENTS), expecting function (T_FUNCTION) in /in/eFkW5 on line 41
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IMPLEMENTS, expecting T_FUNCTION in /in/eFkW5 on line 41
Process exited with code 255.