3v4l.org

run code in 300+ PHP versions simultaneously
<?php class bar { public function setup_pins() { for ($i = 0; $i < 4; $i++) { echo "Setting up pin " . $i . "\n"; $this->pin[$i] = new Pin; $this->pin[$i]->setup_unit(4, array()); } } } class Pin { protected static $c = 0; public function setup_unit($pin_no, $units) { $this->do_counter(); echo self::$c; } public function do_counter() { if (! isset(self::$c)) //this is kinda silly in this scenario { self::$c = 0; echo "Not set\n"; } else { self::$c++; echo "C is " . self::$c . "\n"; } } } $stuff = new bar; $stuff->setup_pins();
Output for git.master, git.master_jit, rfc.property-hooks
Setting up pin 0 Deprecated: Creation of dynamic property bar::$pin is deprecated in /in/OHRRr on line 10 C is 1 1Setting up pin 1 C is 2 2Setting up pin 2 C is 3 3Setting up pin 3 C is 4 4

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