3v4l.org

run code in 300+ PHP versions simultaneously
<?php Class Employee { public string $name; public int $age; public function __construct(string $n, int $a) { $this->name = $n; $this->age = $a; } public function getThis() { return $this; } public function getFullInfo() { return 'Меня зовут ' . $this->name . '. Мне ' . $this->age . ' года.' . PHP_EOL; } } $petr = new Employee('Петр', 23); $valera = new Employee('Валера', 54); print_r($petr->getThis()); print_r($valera->getThis()); echo $petr->getFullInfo(); echo $valera->getFullInfo();
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
Employee Object ( [name] => Петр [age] => 23 ) Employee Object ( [name] => Валера [age] => 54 ) Меня зовут Петр. Мне 23 года. Меня зовут Валера. Мне 54 года.

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:
62.06 ms | 407 KiB | 5 Q