3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Класс Foo */ class Foo { /** @var int Счётчик */ static $counter = 0; /** * Очень хочет сделать Foo и выводит * кучу очень интересной инфы * * @param int $a Первый аргумент * @param int $b Второй аргумент * @return int Сумма аргументов */ public function doFoo($a, $b) { $sum = $a + $b; echo "$a+$b=$sum\n"; return $sum; } /** * Конструктор по-умолчанию выводит количество созданий * объектов класса Foo */ public function __construct() { echo 'Counter: ' . ++self::$counter . PHP_EOL; } } $obj = new Foo(); $obj->doFoo(2,4); new Foo();
Output for git.master, git.master_jit, rfc.property-hooks
Counter: 1 2+4=6 Counter: 2

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:
63.05 ms | 405 KiB | 5 Q