3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Blend\Model; use SebastianBergmann\Money\Money; final abstract class MoneyFactory { public static function __callstatic($meth, array $args) { $meth = strtoupper($meth); if (!self::isValidCurrency($meth)) { throw new InvalidArgumentException("Unknown currency"); } if (!isset($args[0])) { throw new InvalidArgumentException("Missing amount"); } return new Money($args[0] * 100, new Currency($meth)); } private static function isValidCurrency($currency) { if (strlen($currency) != 3) { return false; } try { new Currency($currency); } catch (InvalidArgumentException $e) { return false; } return true; } }
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'abstract' (T_ABSTRACT), expecting class (T_CLASS) in /in/dU1pS on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_ABSTRACT, expecting T_CLASS in /in/dU1pS on line 6
Process exited with code 255.

preferences:
182.54 ms | 1395 KiB | 56 Q