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]); $pdo->exec("create table AB ( a text, b text )"); $pdo->exec("insert into AB(a, b) values('a', 'b')"); $stmt = $pdo->prepare("select a, b from AB"); $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::$b is deprecated in /in/XfAan on line 8 object(AB)#3 (2) { ["a":"AB":private]=> string(1) "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:
41.34 ms | 401 KiB | 8 Q