3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public function __construct(array $values) { print_r($values); } public static function getInstance($db) { $result = $db->query("SELECT * from test"); return new test($result->fetchArray(SQLITE3_ASSOC)); } } $db = new SQLite3(":memory:", SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE); $db->query("CREATE TABLE test (foo, bar)"); test::getInstance($db); print "done";
Output for git.master_jit, git.master
Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, bool given, called in /in/oaYda on line 9 and defined in /in/oaYda:3 Stack trace: #0 /in/oaYda(9): test->__construct(false) #1 /in/oaYda(16): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/oaYda on line 3
Process exited with code 255.
Output for rfc.property-hooks
Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, false given, called in /in/oaYda on line 9 and defined in /in/oaYda:3 Stack trace: #0 /in/oaYda(9): test->__construct(false) #1 /in/oaYda(16): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/oaYda on line 3
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:
45.57 ms | 401 KiB | 8 Q