3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Printable { public function __toString(); } class MyPrintableClass { public $myNumericProperty; public function __construct() { $this->myNumericProperty = 10; } public function __toString() { return 'My numeric property is ' . $this->myNumericProperty; } } function printSomething(string $printable) { echo $printable; } $printable = new MyPrintableClass(); printSomething((string) $printable); printSomething("a real string"); printSomething((string)1234); printSomething((string)1.2); printSomething((string)true);

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.3.60.0040.01116.63
8.3.50.0140.00321.14
8.3.40.0110.00418.93
8.3.30.0120.00918.66
8.3.20.0000.00720.22
8.3.10.0080.00023.84
8.3.00.0050.00319.63
8.2.180.0090.00918.16
8.2.170.0070.00722.96
8.2.160.0070.00720.21
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0060.00317.50
8.2.110.0090.00020.81
8.2.100.0080.00417.84
8.2.90.0030.00519.16
8.2.80.0050.00317.97
8.2.70.0030.00617.75
8.2.60.0000.00818.16
8.2.50.0080.00018.07
8.2.40.0000.00719.41
8.2.30.0050.00319.75
8.2.20.0000.00817.62
8.2.10.0040.00418.08
8.2.00.0040.00417.99
8.1.280.0100.00725.92
8.1.270.0040.00420.27
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0000.00922.14
8.1.230.0000.01018.86
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0090.00317.13
8.1.180.0080.00018.10
8.1.170.0030.00618.49
8.1.160.0000.00721.96
8.1.150.0040.00418.88
8.1.140.0060.00317.32
8.1.130.0070.00017.74
8.1.120.0050.00217.46
8.1.110.0040.00417.42
8.1.100.0030.00717.54
8.1.90.0050.00317.44
8.1.80.0070.00017.33
8.1.70.0040.00417.35
8.1.60.0040.00417.48
8.1.50.0040.00417.55
8.1.40.0040.00417.55
8.1.30.0030.00517.64
8.1.20.0050.00317.49
8.1.10.0040.00417.59
8.1.00.0040.00417.50
8.0.300.0030.00518.77
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0000.00717.21
8.0.260.0030.00317.21
8.0.250.0040.00416.96
8.0.240.0060.00317.01
8.0.230.0030.00416.91
8.0.220.0000.00716.83
8.0.210.0030.00316.94
8.0.200.0000.00617.07
8.0.190.0000.00717.02
8.0.180.0060.00316.98
8.0.170.0000.00817.03
8.0.160.0030.00516.87
8.0.150.0050.00316.82
8.0.140.0000.00716.95
8.0.130.0030.00313.39
8.0.120.0040.00416.92
8.0.110.0050.00216.82
8.0.100.0040.00416.88
8.0.90.0000.00716.90
8.0.80.0000.01716.93
8.0.70.0000.00716.81
8.0.60.0050.00316.75
8.0.50.0040.00416.84
8.0.30.0080.01117.06
8.0.20.0140.00517.40
8.0.10.0040.00416.87
8.0.00.0070.01016.75
7.4.330.0050.00015.08
7.4.320.0070.00016.57
7.4.300.0000.00616.52
7.4.290.0070.00016.61
7.4.280.0000.00716.49
7.4.270.0060.00016.43
7.4.260.0070.00316.51
7.4.250.0000.00716.53
7.4.240.0020.00516.59
7.4.230.0000.00716.50
7.4.220.0150.00316.45
7.4.210.0030.01116.64
7.4.200.0000.00716.30
7.4.160.0140.00316.47
7.4.150.0140.00617.40
7.4.140.0110.00717.86
7.4.130.0060.01316.51
7.4.120.0080.01216.48
7.4.110.0120.00616.61
7.4.100.0110.00716.42
7.4.90.0140.00316.50
7.4.80.0030.01619.39
7.4.70.0110.01116.49
7.4.60.0200.00016.39
7.4.50.0040.00416.46
7.4.40.0040.01216.50
7.4.30.0060.01116.44
7.4.00.0090.00314.54
7.3.330.0030.00313.33
7.3.320.0030.00313.36
7.3.310.0050.00316.39
7.3.300.0030.00316.25
7.3.290.0070.00916.35
7.3.280.0100.01216.33
7.3.270.0090.00917.40
7.3.260.0150.00616.54
7.3.250.0140.00616.53
7.3.240.0060.01216.39
7.3.230.0130.00616.64
7.3.210.0110.00616.39
7.3.200.0070.01516.42
7.3.190.0030.01316.66
7.3.180.0100.00616.59
7.3.170.0090.00916.36
7.3.160.0030.01316.27
7.2.330.0130.00616.80
7.2.320.0100.01316.46
7.2.310.0060.01316.81
7.2.300.0120.00616.66
7.2.290.0140.00316.72
7.2.60.0030.01316.84
7.2.00.0000.01219.55
7.1.200.0080.00415.70
7.1.100.0110.00417.84
7.1.70.0000.01417.09
7.1.60.0090.01520.03
7.1.50.0030.01716.93
7.1.00.0030.07722.31
7.0.200.0030.00316.88
7.0.60.0070.08020.05
7.0.50.0070.08317.93
7.0.40.0100.07020.24
7.0.30.0230.08320.16
7.0.20.0170.04320.10
7.0.10.0030.04320.07
7.0.00.0130.03720.35
5.6.280.0000.06721.00
5.6.210.0070.05020.65
5.6.200.0170.07318.13
5.6.190.0130.03320.33
5.6.180.0400.03320.58
5.6.170.0230.05720.47
5.6.160.0170.06720.71
5.6.150.0030.04318.21
5.6.140.0100.07318.17
5.6.130.0000.06018.15
5.6.120.0030.04721.02
5.6.110.0130.05721.01
5.6.100.0170.07321.01
5.6.90.0170.07020.96
5.6.80.0100.06020.40
5.5.350.0270.07020.36
5.5.340.0170.06317.98
5.5.330.0030.09020.46
5.5.320.0200.06020.20
5.5.310.0300.07720.34
5.5.300.0030.08018.05
5.5.290.0100.05317.98
5.5.280.0070.08720.95
5.5.270.0070.05720.87
5.5.260.0070.05020.77
5.5.250.0100.05720.77
5.5.240.0070.06320.19
5.4.450.0170.06319.53
5.4.440.0000.06719.45
5.4.430.0430.04719.20
5.4.420.0430.05719.61
5.4.410.0470.05019.05
5.4.400.0300.05719.27
5.4.390.0270.04719.26
5.4.380.0100.05319.15
5.4.370.0230.04719.13
5.4.360.0200.06319.27
5.4.350.0130.04719.02
5.4.340.0130.05319.30
5.4.320.0270.06319.00
5.4.310.0400.04019.28
5.4.300.0370.05019.27
5.4.290.0170.04719.36
5.4.280.0100.05719.00
5.4.270.0470.05319.14
5.4.260.0470.05719.15
5.4.250.0470.05719.17
5.4.240.0500.04719.10
5.4.230.0270.05319.12
5.4.220.0400.05719.12
5.4.210.0400.06019.14
5.4.200.0500.05019.29
5.4.190.0470.05318.84
5.4.180.0470.05019.21
5.4.170.0470.05719.04
5.4.160.0370.06018.99
5.4.150.0470.06019.11
5.4.140.0470.05316.62
5.4.130.0400.04716.45
5.4.120.0470.04016.38
5.4.110.0470.04316.45
5.4.100.0400.05016.31
5.4.90.0470.04716.68
5.4.80.0470.05016.55
5.4.70.0230.07016.49
5.4.60.0230.06316.26
5.4.50.0170.04016.49
5.4.40.0400.06016.55
5.4.30.0030.05316.42
5.4.20.0230.06716.52
5.4.10.0300.03716.52

preferences:
60.25 ms | 401 KiB | 5 Q