3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Authenticator { protected $isloggedin; protected $session; public function __construct(Session $session) { $this->session = $session; if ( ! empty($session->get('isloggedin')) && $session->get('isloggedin') == true) { //$isl = $session->get('isloggedin'); //if ( ! empty($isl) && $isl == true) { $this->isloggedin = true; } } } class BasicSession { protected $session = array(); public function get($key) { if (isset($this->session[$key])) { return $this->session[$key]; } return false; } } try { $sess = new BasicSession(); $auth = new Authenticator($sess); } catch (Exception $e) { die('System go KA-BOOM! ' . $e->getMessage()); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Authenticator::__construct(): Argument #1 ($session) must be of type Session, BasicSession given, called in /in/WOr3V on line 31 and defined in /in/WOr3V:7 Stack trace: #0 /in/WOr3V(31): Authenticator->__construct(Object(BasicSession)) #1 {main} thrown in /in/WOr3V on line 7
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
51.52 ms | 401 KiB | 8 Q