3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AB { private $a; public function __set($n, $v) { $this->$n = "set: {$v}"; } } $pdo = new pdo('sqlite::memory:', null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); $stmt = $pdo->prepare("select 'a', 'b'"); $stmt->execute(); $stmt->setFetchMode(PDO::FETCH_CLASS, 'AB'); $ab = $stmt->fetch(); var_dump($ab);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property AB::$'a' is deprecated in /in/PDo0m on line 8 Deprecated: Creation of dynamic property AB::$'b' is deprecated in /in/PDo0m on line 8 object(AB)#3 (3) { ["a":"AB":private]=> NULL ["'a'"]=> string(6) "set: a" ["'b'"]=> string(6) "set: b" }

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:
42.8 ms | 401 KiB | 8 Q