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"); var_dump($result->fetchArray(SQLITE3_ASSOC)); 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
bool(false) Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, bool given, called in /in/0DDdo on line 10 and defined in /in/0DDdo:3 Stack trace: #0 /in/0DDdo(10): test->__construct(false) #1 /in/0DDdo(17): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/0DDdo on line 3
Process exited with code 255.
Output for rfc.property-hooks
bool(false) Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, false given, called in /in/0DDdo on line 10 and defined in /in/0DDdo:3 Stack trace: #0 /in/0DDdo(10): test->__construct(false) #1 /in/0DDdo(17): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/0DDdo 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:
55.16 ms | 401 KiB | 8 Q