3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generateRandomString() { return 4; } class Connection { public function execute($query) { return true; } } class ConnectionFactory { public static function CreateConnection() { return new Connection; } } function pg_escape($data) { return $data; } class LocalAuth { protected $login; protected $pass; protected $salt; function Store(){ $db = ConnectionFactory::CreateConnection(); $q = "insert into localauth (login, pass, salt) values ('".$this->login."','".$this->pass."','".$this->salt."');"; $db->execute($q); } } $auth= new LocalAuth(); $auth->login= pg_escape($_POST['login']); $auth->pass= pg_escape($_POST['pass']); $auth->salt = generateRandomString(); $auth->Store();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "login" in /in/i5Sj2 on line 46 Fatal error: Uncaught Error: Cannot access protected property LocalAuth::$login in /in/i5Sj2:46 Stack trace: #0 {main} thrown in /in/i5Sj2 on line 46
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:
50.55 ms | 401 KiB | 8 Q