3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private string $firstName; private string $lastName; private int $age; public function __construct(string $firstName,string $lastName,int $age) { $this->firstName=$firstName; $this->lastName=$lastName; $this->age=$age; } public function renderHtml(){ $html=""; $template="<p><b>%s:</b> %s</p>"; foreach (get_object_vars($this) as $k=>$v) { $html.=sprintf($template,ucfirst($k),$v); } return $html; } } $unaPersona=new Person("Pedro","Serrano",25); echo $unaPersona->renderHtml(); //var_dump($unaPersona); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.30.0100.00919.46
8.5.20.0090.00820.38
8.5.10.0130.00716.65
8.5.00.0100.01119.96
8.4.180.0150.00725.81
8.4.170.0150.00723.95
8.4.160.0110.00923.98
8.4.150.0070.00516.83
8.4.140.0150.00617.76
8.4.130.0060.00717.87
8.4.120.0130.00720.43
8.4.110.0160.00422.59
8.4.100.0060.00317.99
8.4.90.0050.00418.64
8.4.80.0120.00719.77
8.4.70.0080.00417.68
8.4.60.0060.01017.79
8.4.50.0110.00818.57
8.4.40.0130.00617.98
8.4.30.0170.00318.81
8.4.20.0130.00617.88
8.4.10.0130.00719.69
8.3.300.0120.01020.79
8.3.290.0150.00820.49
8.3.280.0060.00517.03
8.3.270.0110.00916.83
8.3.260.0110.00916.43
8.3.250.0110.00718.65
8.3.240.0090.00816.49
8.3.230.0110.00916.54
8.3.220.0050.00317.51
8.3.210.0030.00416.75
8.3.200.0110.00916.61
8.3.190.0120.00617.28
8.3.180.0100.00916.57
8.3.170.0140.00419.01
8.3.160.0150.00318.34
8.3.150.0040.01517.25
8.3.140.0050.00317.03
8.3.130.0060.00318.51
8.3.120.0040.00420.63
8.3.110.0040.00820.94
8.3.100.0040.00424.06
8.3.90.0080.00026.77
8.3.80.0060.00318.30
8.3.70.0070.01418.30
8.3.60.0070.00718.54
8.3.50.0040.01516.39
8.3.40.0100.01021.95
8.3.30.0030.01222.15
8.3.20.0210.00625.66
8.3.10.0150.00325.66
8.3.00.0160.00325.66
8.2.300.0120.00918.97
8.2.290.0120.00720.58
8.2.280.0110.00716.56
8.2.270.0130.00717.16
8.2.260.0130.00618.55
8.2.250.0130.00618.47
8.2.240.0050.00318.93
8.2.230.0030.01322.58
8.2.220.0030.00537.54
8.2.210.0050.00326.77
8.2.200.0030.00616.63
8.2.190.0120.00916.58
8.2.180.0070.01016.75
8.2.170.0100.00722.96
8.2.160.0110.00422.96
8.2.150.0290.01125.66
8.2.140.0030.01725.66
8.2.130.0150.00625.66
8.2.120.0070.01825.66
8.2.110.0090.00925.66
8.2.100.0190.01025.66
8.2.90.0270.00325.66
8.2.80.0100.01025.66
8.2.70.0340.00325.66
8.2.60.0210.00025.66
8.2.50.0320.00625.66
8.2.40.0150.00325.66
8.2.30.0130.00725.66
8.2.20.0040.01225.66
8.2.10.0120.00325.66
8.2.00.0100.00025.66
8.1.340.0060.00319.89
8.1.330.0110.00823.57
8.1.320.0140.00516.14
8.1.310.0140.00416.60
8.1.300.0060.00320.11
8.1.290.0040.00430.84
8.1.280.0110.00425.92
8.1.270.0080.00025.66
8.1.260.0030.01425.66
8.1.250.0070.00325.66
8.1.240.0160.00025.66
8.1.230.0150.00625.66
8.1.220.0200.00325.66
8.1.210.0150.01225.66
8.1.200.0120.00925.66
8.1.190.0040.01525.66
8.1.180.0220.00625.66
8.1.170.0090.00925.66
8.1.160.0150.01225.66
8.1.150.0100.01025.66
8.1.140.0180.01125.66
8.1.130.0250.00025.66
8.1.120.0070.01425.66
8.1.110.0150.00625.66
8.1.100.0070.01125.66
8.1.90.0070.01325.66
8.1.80.0100.01025.66
8.1.70.0100.01025.66
8.1.60.0150.01125.66
8.1.50.0130.00625.66
8.1.40.0130.00625.66
8.1.30.0200.00725.66
8.1.20.0310.00025.66
8.1.10.0340.00025.66
8.1.00.0100.01025.66

preferences:
55.05 ms | 993 KiB | 5 Q