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)"); $db->query("INSERT INTO test ('foo', 'bar')"); test::getInstance($db); print "done"; ?>
Output for git.master_jit, git.master
Warning: SQLite3::query(): incomplete input in /in/CEBQX on line 16 bool(false) Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, bool given, called in /in/CEBQX on line 10 and defined in /in/CEBQX:3 Stack trace: #0 /in/CEBQX(10): test->__construct(false) #1 /in/CEBQX(18): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/CEBQX on line 3
Process exited with code 255.
Output for rfc.property-hooks
Warning: SQLite3::query(): incomplete input in /in/CEBQX on line 16 bool(false) Fatal error: Uncaught TypeError: test::__construct(): Argument #1 ($values) must be of type array, false given, called in /in/CEBQX on line 10 and defined in /in/CEBQX:3 Stack trace: #0 /in/CEBQX(10): test->__construct(false) #1 /in/CEBQX(18): test::getInstance(Object(SQLite3)) #2 {main} thrown in /in/CEBQX 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:
35.11 ms | 401 KiB | 8 Q