3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ManagerSupervisorV1 { private string $name; private float $salary; public function __construct(string $name = 'Руководитель менеджеров', float $salary = 1.5) { $this->name = $name; $this->salary = $salary; } } var_dump(new ManagerSupervisorV1); class ManagerSupervisorV2 { private string $name = 'Руководитель менеджеров'; private float $salary = 1.5; public function __construct(string $name = null, float $salary = null) { $this->name = $this->name ?: $name; $this->salary = $this->salary ?: $salary; } } var_dump(new ManagerSupervisorV2); class ManagerSupervisorV3 { public function __construct( private string $name = 'Руководитель менеджеров', private float $salary = 1.5, ) {} } var_dump(new ManagerSupervisorV3);
Output for git.master_jit, git.master
Deprecated: ManagerSupervisorV2::__construct(): Implicitly marking parameter $name as nullable is deprecated, the explicit nullable type must be used instead in /in/SAXOb on line 19 Deprecated: ManagerSupervisorV2::__construct(): Implicitly marking parameter $salary as nullable is deprecated, the explicit nullable type must be used instead in /in/SAXOb on line 19 object(ManagerSupervisorV1)#1 (2) { ["name":"ManagerSupervisorV1":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV1":private]=> float(1.5) } object(ManagerSupervisorV2)#1 (2) { ["name":"ManagerSupervisorV2":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV2":private]=> float(1.5) } object(ManagerSupervisorV3)#1 (2) { ["name":"ManagerSupervisorV3":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV3":private]=> float(1.5) }
Output for rfc.property-hooks
object(ManagerSupervisorV1)#1 (2) { ["name":"ManagerSupervisorV1":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV1":private]=> float(1.5) } object(ManagerSupervisorV2)#1 (2) { ["name":"ManagerSupervisorV2":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV2":private]=> float(1.5) } object(ManagerSupervisorV3)#1 (2) { ["name":"ManagerSupervisorV3":private]=> string(45) "Руководитель менеджеров" ["salary":"ManagerSupervisorV3":private]=> float(1.5) }

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:
35.2 ms | 409 KiB | 5 Q