3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Container { protected $s=array(); function __set($k, $c) { $this->s[$k]=$c; } function __get($k) { return $this->s[$k]($this); } } $c = new Container(); // parameters $c->mailer_class = function () { return 'Zend_Mail'; }; $c->mailer_username = function () { return 'fabien'; }; $c->mailer_password = function () { return 'myPass'; }; // objects / services $c->mailer_transport = function ($c) { return new Zend_Mail_Transport_Smtp( 'smtp.gmail.com', array( 'auth' => 'login', 'username' => $c->mailer_username, 'password' => $c->mailer_password, 'ssl' => 'ssl', 'port' => 465, ) ); }; $c->mailer = function ($c) { $obj = new $c->mailer_class(); $obj->setDefaultTransport($c->mailer_transport); return $obj; }; // get the mailer $mailer = $c->mailer;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Zend_Mail" not found in /in/9MsEp:30 Stack trace: #0 /in/9MsEp(6): {closure}(Object(Container)) #1 /in/9MsEp(36): Container->__get('mailer') #2 {main} thrown in /in/9MsEp on line 30
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:
58.32 ms | 401 KiB | 8 Q