3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private $a = 1; protected $b = 2; public $c = 3; private $d = 4; protected $e = 5; public $f = 6; } $obj = new test; echo "BROKEN:\n"; var_dump(reset($obj)); var_dump(current($obj)); var_dump(next($obj)); var_dump(prev($obj)); var_dump(end($obj)); echo "\nWORKING:\n"; foreach ($obj as $item) { var_dump($item); }
Output for git.master, git.master_jit, rfc.property-hooks
BROKEN: Deprecated: reset(): Calling reset() on an object is deprecated in /in/5e6Ok on line 15 int(1) Deprecated: current(): Calling current() on an object is deprecated in /in/5e6Ok on line 16 int(1) Deprecated: next(): Calling next() on an object is deprecated in /in/5e6Ok on line 17 int(2) Deprecated: prev(): Calling prev() on an object is deprecated in /in/5e6Ok on line 18 int(1) Deprecated: end(): Calling end() on an object is deprecated in /in/5e6Ok on line 19 int(6) WORKING: int(3) int(6)

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:
61.46 ms | 402 KiB | 8 Q