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, git.master_jit, rfc.property-hooks
Warning: SQLite3::__construct(): open_basedir restriction in effect. File(/:memory) is not within the allowed path(s): (/tmp:/in:/etc) in /in/vkkUG on line 13 Fatal error: Uncaught Exception: open_basedir prohibits opening /:memory in /in/vkkUG:13 Stack trace: #0 /in/vkkUG(13): SQLite3->__construct(':memory', 6) #1 {main} thrown in /in/vkkUG on line 13
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:
49.79 ms | 401 KiB | 8 Q