3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * The basic registry interface. * * @author Time.ly Network, Inc. * @since 2.0 * @package Ai1EC * @subpackage Ai1EC.Object */ interface Ai1ec_Registry { /** * Retrieves the key from the registry * * @param string $key * * @return mixed the value associated to the key. */ public function get( $key ); /** * Set the key into the registry. * * @param string $key * @param mixed $value */ public function set( $key, $value ); } /** * Application Registry: handles application wide variables. * * @author Time.ly Network, Inc. * @since 2.0 * @package Ai1EC * @subpackage Ai1EC.Object */ class Ai1ec_Registry_Application implements Ai1ec_Registry { /** * @var Ai1ec_Registry_Object */ protected $_registry; /** * @var array */ protected $_environment = array(); /** * The contructor method. * * @param Ai1ec_Registry_Object $registry */ function __construct( Ai1ec_Registry_Object $registry ) { $this->_registry = $registry; } /* (non-PHPdoc) * @see Ai1ec_Registry::get() */ public function get( $key ) { if ( ! isset ( $this->_environment[$key] ) ) { return false; } return $this->_environment[$key]; } /* (non-PHPdoc) * @see Ai1ec_Registry::set() */ public function set( $key, $value ) { $this->_environment[$key] = $value; } } $app = new Ai1ec_Registry_Application(); $app->set( 'foo', 'baz' ); echo $app->get( 'foo' );
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Ai1ec_Registry_Application::__construct(), 0 passed in /in/cYo3V on line 77 and exactly 1 expected in /in/cYo3V:55 Stack trace: #0 /in/cYo3V(77): Ai1ec_Registry_Application->__construct() #1 {main} thrown in /in/cYo3V on line 55
Process exited with code 255.
Output for 7.0.0 - 7.0.14
Fatal error: Uncaught TypeError: Argument 1 passed to Ai1ec_Registry_Application::__construct() must be an instance of Ai1ec_Registry_Object, none given, called in /in/cYo3V on line 77 and defined in /in/cYo3V:55 Stack trace: #0 /in/cYo3V(77): Ai1ec_Registry_Application->__construct() #1 {main} thrown in /in/cYo3V on line 55
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Catchable fatal error: Argument 1 passed to Ai1ec_Registry_Application::__construct() must be an instance of Ai1ec_Registry_Object, none given, called in /in/cYo3V on line 77 and defined in /in/cYo3V on line 55
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Argument 1 passed to Ai1ec_Registry_Application::__construct() must be an object of class Ai1ec_Registry_Object, called in /in/cYo3V on line 77 and defined in /in/cYo3V on line 55
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Argument 1 must be an object of class Ai1ec_Registry_Object in /in/cYo3V on line 55
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/cYo3V on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/cYo3V on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/cYo3V on line 10
Process exited with code 255.