3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Banana {} class Football {} abstract class Point { abstract public function add(Point $other); abstract public function subtract(Point $other); } class Vector2 extends Point { public function add(Point|Banana $other) { if (!$other instanceof Banana) { throw new TypeError("Point only allowed to prevent compiler errors"); } // ...rest of the function } public function subtract(Point|Football $other) { if (!$other instanceof Football) { throw new TypeError("Point only allowed to prevent compiler errors"); } // ...rest of the function } } (new Vector2())->subtract( new Football() );

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.00.0090.01220.08
8.4.150.0010.00114.05
8.4.140.0140.00717.71
8.4.130.0040.00417.55
8.4.120.0110.01024.22
8.4.110.0110.01022.54
8.4.100.0110.00917.65
8.4.90.0100.00918.50
8.4.80.0080.00117.77
8.4.70.0040.00519.33
8.4.60.0090.00718.70
8.4.50.0110.00719.57
8.4.40.0430.01117.53
8.4.30.0350.00617.17
8.4.20.0360.00917.56
8.4.10.0330.01017.21
8.3.280.0080.01119.98
8.3.270.0100.01016.80
8.3.260.0130.00616.95
8.3.250.0080.00818.81
8.3.240.0140.00516.97
8.3.230.0100.00616.56
8.3.220.0120.00617.27
8.3.210.0100.01016.77
8.3.200.0050.00516.59
8.3.190.0110.00616.70
8.3.180.0060.00416.53
8.3.170.0360.01216.32
8.3.160.0390.00516.41
8.3.150.0380.00816.18
8.3.140.0400.00816.48
8.3.130.0440.00816.43
8.3.120.0380.00816.09
8.3.110.0340.01016.29
8.3.100.0360.00816.16
8.3.90.0360.01016.29
8.3.80.0350.01016.21
8.3.70.0370.00816.34
8.3.60.0400.00616.20
8.3.50.0380.00616.48
8.3.40.0340.00517.25
8.3.30.0240.01217.31
8.3.20.0330.00817.48
8.3.10.0320.00717.29
8.3.00.0200.00617.30
8.2.290.0100.00920.10
8.2.280.0150.00418.53
8.2.270.0300.00716.45
8.2.260.0280.01116.41
8.2.250.0330.00616.57
8.2.240.0310.00716.14
8.2.230.0280.01016.27
8.2.220.0280.01016.54
8.2.210.0310.00816.58
8.2.200.0280.01116.51
8.2.190.0300.00916.38
8.2.180.0310.00716.33
8.2.170.0340.00717.50
8.2.160.0310.01017.66
8.2.150.0350.00717.46
8.2.140.0290.01317.13
8.2.130.0390.00817.16
8.2.120.0430.00417.52
8.2.110.0380.00617.46
8.2.100.0330.00617.72
8.2.90.0300.01017.45
8.2.80.0250.01017.45
8.2.70.0290.00917.25
8.2.60.0310.00917.19
8.2.50.0330.00717.41
8.2.40.0230.00717.24
8.2.30.0170.00517.02
8.2.20.0360.00817.36
8.2.10.0260.00717.52
8.2.00.0340.00917.34
8.1.320.0040.00417.73

preferences:
28.5 ms | 403 KiB | 5 Q