3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Employee { protected $salary; public function __construct($salary) { $this->salary = $salary; } public function getSalary() { return $this->salary; } } class Manager extends Employee { protected $bonus; public function __construct($salary, $bonus) { parent::__construct($salary); $this->bonus = $bonus; } public function getSalary() { return $this->salary + $this->bonus; } } function printEmployeeSalary(Employee $employee) { echo "Salary: " . $employee->getSalary() . "\n"; } $employee = new Employee(3000); $manager = new Manager(5000, 2000); printEmployeeSalary($employee); // Ожидается: Salary: 3000 printEmployeeSalary($manager); // Ожидается: Salary: 7000
Output for git.master_jit, git.master
Salary: 3000 Salary: 7000

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