3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Shipping { private $company; function __construct(){ $this->company = ""; } function setStrategy($company){ $this->company = $company; } function calculate ($package){ return $this->company->calculate($package); } } interface Company { public function calculate(); } class UPS implements Company{ } class USPS implements Company{ } class FedEx implements Company { }
Output for 7.0.30 - 7.3.0beta1
Fatal error: Class UPS contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Company::calculate) in /in/CWtAT on line 25
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Class UPS contains abstract method (calculate) and must therefore be declared abstract or implement the remaining methods in /in/CWtAT:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Class UPS contains abstract method (calculate) and must therefore be declared abstract or implement the remaining methods in /in/CWtAT:25 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.30
Fatal error: Class UPS contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Company::calculate) in /in/CWtAT on line 27
Process exited with code 255.