3v4l.org

run code in 500+ PHP versions simultaneously
<?php class User { public function __construct(public readonly string $name) {} public function say() { echo $this->name, PHP_EOL; } } class Student extends User { // } function listAll(User ...$users) { array_map( callback: fn(User $user) => $user->say(), array: $users ); } $users = [ new User('Jhon'), new User('Jane'), new Student('Bob'), // Child Student Class works. //'not User Class', // passing anything other than class User will throw TypeError. ]; listAll(...$users);

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.00819.69
8.5.20.0090.00819.88
8.5.10.0090.00919.63
8.5.00.0120.00920.07
8.4.180.0120.01023.91
8.4.170.0170.00821.90
8.4.160.0120.01023.81
8.4.150.0090.00416.87
8.4.140.0130.00817.66
8.4.130.0100.01018.75
8.4.120.0130.00819.33
8.4.110.0090.01219.47
8.4.100.0130.00817.48
8.4.90.0100.01022.55
8.4.80.0030.00518.88
8.4.70.0140.00718.78
8.4.60.0080.01218.68
8.4.50.0130.00718.81
8.4.40.0130.00720.47
8.4.30.0100.01022.20
8.4.20.0040.00719.73
8.4.10.0000.00921.93
8.3.300.0090.01320.27
8.3.290.0090.01318.52
8.3.280.0110.00920.98
8.3.270.0090.01116.71
8.3.260.0080.01216.70
8.3.250.0090.00816.54
8.3.240.0080.00816.86
8.3.230.0120.00816.70
8.3.220.0070.00018.82
8.3.210.0070.00816.64
8.3.200.0120.00816.41
8.3.190.0080.00717.20
8.3.180.0040.00419.10
8.3.170.0070.01119.17
8.3.160.0040.01518.50
8.3.150.0090.00918.86
8.3.140.0030.01020.82
8.3.130.0080.00018.43
8.3.120.0040.00419.08
8.3.110.0120.00422.58
8.3.100.0080.00022.58
8.3.90.0030.00622.58
8.3.50.0030.00622.58
8.2.300.0110.00918.16
8.2.290.0120.00718.44
8.2.280.0120.00818.52
8.2.270.0100.01016.74
8.2.260.0140.00417.23
8.2.250.0060.00316.82
8.2.240.0080.00019.07
8.2.230.0040.00422.58
8.2.220.0050.00322.58
8.2.210.0000.01022.58
8.2.60.0070.00717.40
8.1.340.0130.00817.57
8.1.330.0100.01016.13
8.1.320.0150.00618.01
8.1.310.0100.00716.76
8.1.300.0190.00019.82

preferences:
43.13 ms | 731 KiB | 5 Q