3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Ettore; use Pimple\Container; use Pimple\ServiceProviderInterface; class Ettore { public static function fromServiceProviders(array $providers) : Ettore { $pimple = new Container(); array_walk($providers, function(ServiceProviderInterface $provider, $i, Container $pimple) { $pimple->register($provider); }, $pimple); return new static(new App\App(new App\ServiceContainer($pimple))); } public function test() { echo 'Ok'; } } $e = new Ettore(); $e->test();
Output for 7.0.0 - 7.2.0
Ok
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/jTZdn on line 9
Process exited with code 255.