3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Currency { public $currencyCode; public function __construct($currencyCode) { $this->currencyCode = $currencyCode; } public function equals(Currency $currency) { return $this->currencyCode === $currency->currencyCode; } } class Money { public $amount; public $currency; public function __construct($amount, Currency $currency = null) { $this->currency = $currency ?: new Currency('USD'); } } $revenue = new Money(55, new Currency('GBP')); var_dump($revenue->currency->equals(new Currency('GBP'))); $assets = new Money(55); var_dump($assets->currency->equals(new Currency('USD')));

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.0070.01318.43
8.3.50.0040.01418.39
8.3.40.0090.00618.79
8.3.30.0110.00319.25
8.3.20.0030.00520.38
8.3.10.0050.00320.57
8.3.00.0030.00519.79
8.2.180.0160.00316.50
8.2.170.0120.00322.96
8.2.160.0040.00920.17
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00722.29
8.2.110.0000.00821.05
8.2.100.0040.00817.88
8.2.90.0080.00019.26
8.2.80.0080.00017.97
8.2.70.0000.00917.38
8.2.60.0040.00417.93
8.2.50.0090.00018.07
8.2.40.0040.00418.34
8.2.30.0000.00819.32
8.2.20.0040.00417.61
8.2.10.0050.00318.08
8.2.00.0040.00417.69
8.1.280.0040.01125.92
8.1.270.0090.00621.98
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.01022.11
8.1.230.0080.00320.70
8.1.220.0030.00617.76
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0050.00317.11
8.1.180.0040.00418.10
8.1.170.0030.00518.58
8.1.160.0050.00321.93
8.1.150.0050.00218.96
8.1.140.0030.00517.47
8.1.130.0000.00817.84
8.1.120.0030.00517.50
8.1.110.0040.00417.38
8.1.100.0070.00017.43
8.1.90.0000.00717.45
8.1.80.0070.00017.38
8.1.70.0050.00217.44
8.1.60.0090.00017.57
8.1.50.0030.00517.55
8.1.40.0030.00517.42
8.1.30.0040.00417.62
8.1.20.0000.00817.66
8.1.10.0040.00417.47
8.1.00.0030.00717.44
8.0.300.0040.00418.77
8.0.290.0040.00416.73
8.0.280.0030.00318.48
8.0.270.0030.00316.89
8.0.260.0030.00317.32
8.0.250.0000.00717.05
8.0.240.0070.00016.97
8.0.230.0000.00716.97
8.0.220.0000.00716.87
8.0.210.0040.00417.00
8.0.200.0030.00517.07
8.0.190.0030.00617.03
8.0.180.0040.00416.87
8.0.170.0040.00416.92
8.0.160.0040.00416.91
8.0.150.0000.00716.80
8.0.140.0000.00716.84
8.0.130.0000.00613.37
8.0.120.0000.00816.91
8.0.110.0000.00716.89
8.0.100.0030.00316.75
8.0.90.0000.00816.78
8.0.80.0000.01616.96
8.0.70.0000.00717.00
8.0.60.0040.00417.09
8.0.50.0040.00417.04
8.0.30.0110.00817.32
8.0.20.0100.00817.42
8.0.10.0000.00716.97
8.0.00.0110.00716.94
7.4.330.0020.00215.05
7.4.320.0030.00316.43
7.4.300.0060.00016.64
7.4.290.0000.00616.47
7.4.280.0000.00816.52
7.4.270.0030.00316.46
7.4.260.0000.00716.50
7.4.250.0000.00716.58
7.4.240.0040.00416.62
7.4.230.0000.00716.71
7.4.220.0100.01316.73
7.4.210.0070.01316.64
7.4.200.0040.00416.72
7.4.160.0070.01016.36
7.4.150.0080.00917.40
7.4.140.0150.00517.86
7.4.130.0110.00916.59
7.4.120.0100.00916.46
7.4.110.0090.00716.61
7.4.100.0110.00716.53
7.4.90.0060.01016.50
7.4.80.0170.00016.52
7.4.70.0060.01016.45
7.4.60.0030.01316.48
7.4.50.0040.00416.41
7.4.40.0000.01516.43
7.4.30.0110.00416.48
7.4.00.0100.00315.18
7.3.330.0030.00313.24
7.3.320.0050.00013.36
7.3.310.0000.00716.33
7.3.300.0000.00716.43
7.3.290.0110.00316.39
7.3.280.0080.00916.37
7.3.270.0060.01117.40
7.3.260.0060.01216.73
7.3.250.0090.00816.40
7.3.240.0160.00316.39
7.3.230.0090.00916.39
7.3.210.0080.00816.35
7.3.200.0100.00719.39
7.3.190.0060.01016.42
7.3.180.0120.00916.35
7.3.170.0090.00616.57
7.3.160.0030.01216.54
7.2.330.0100.00716.80
7.2.320.0140.00316.54
7.2.310.0130.00416.79
7.2.300.0160.00616.84
7.2.290.0060.01316.76
7.2.60.0070.00716.69
7.2.00.0070.00719.28
7.1.200.0060.00615.71
7.1.100.1110.01816.46
7.1.70.0000.01017.18
7.1.60.0070.00719.32
7.1.50.0110.01417.05
7.1.00.0000.08022.47
7.0.200.0000.00916.73
7.0.140.0030.07321.92
7.0.60.0130.06019.98
7.0.50.0100.08017.96
7.0.40.0030.07320.04
7.0.30.0300.03020.11
7.0.20.0230.08020.07
7.0.10.0130.03720.23
7.0.00.0000.04320.16
5.6.280.0000.07720.86
5.6.210.0230.06020.56
5.6.200.0100.04318.22
5.6.190.0070.05020.42
5.6.180.0630.06020.75
5.6.170.0300.07020.62
5.6.160.0000.05320.66
5.6.150.0070.08318.15
5.6.140.0100.08018.25
5.6.130.0030.08318.17
5.6.120.0130.06320.81
5.6.110.0100.03720.89
5.6.100.0130.08020.89
5.6.90.0030.05021.01
5.6.80.0000.07320.41
5.5.350.0170.07320.45
5.5.340.0030.04317.95
5.5.330.0030.04020.43
5.5.320.0400.06720.42
5.5.310.0230.06320.30
5.5.300.0100.05018.07
5.5.290.0100.03717.97
5.5.280.0130.08020.85
5.5.270.0070.08320.86
5.5.260.0000.04720.89
5.5.250.0170.07320.71
5.5.240.0230.05320.29
5.4.450.0430.04719.66
5.4.440.0870.07019.63
5.4.430.0630.06719.54
5.4.420.0930.05719.47
5.4.410.0700.05319.32
5.4.400.0100.05319.13
5.4.390.0830.05319.14
5.4.380.0400.07318.63
5.4.370.0370.05318.66
5.4.360.0400.05718.57
5.4.350.0330.06018.77
5.4.340.0430.05018.77
5.4.320.0080.05012.51
5.4.310.0070.03812.50
5.4.300.0100.03412.50
5.4.290.0090.04012.50
5.4.280.0060.03912.39
5.4.270.0050.03712.40
5.4.260.0070.03712.39
5.4.250.0070.03712.40
5.4.240.0090.03312.40
5.4.230.0050.04112.39
5.4.220.0040.04112.39
5.4.210.0050.03612.39
5.4.200.0070.04212.39
5.4.190.0060.03612.39
5.4.180.0080.03812.38
5.4.170.0100.03112.39
5.4.160.0090.03212.39
5.4.150.0060.03412.39
5.4.140.0050.04212.07
5.4.130.0060.03412.07
5.4.120.0050.03512.02
5.4.110.0090.03412.01
5.4.100.0030.03812.01
5.4.90.0040.04112.02
5.4.80.0040.04112.02
5.4.70.0100.03012.02
5.4.60.0070.03212.01
5.4.50.0050.03912.02
5.4.40.0070.03912.00
5.4.30.0070.03312.00
5.4.20.0050.03512.00
5.4.10.0080.03612.00
5.4.00.0070.03911.49
5.3.290.0050.03812.80
5.3.280.0060.04312.71
5.3.270.0060.04112.72
5.3.260.0050.03912.72
5.3.250.0080.03512.72
5.3.240.0060.03612.72
5.3.230.0060.03612.71
5.3.220.0070.03612.68
5.3.210.0060.03712.68
5.3.200.0060.03512.68
5.3.190.0080.03512.68
5.3.180.0090.04012.67
5.3.170.0030.03812.67
5.3.160.0080.04112.67
5.3.150.0100.04312.67
5.3.140.0070.03412.66
5.3.130.0090.03512.66
5.3.120.0040.04212.66
5.3.110.0080.04312.66
5.3.100.0070.03912.13
5.3.90.0070.04612.11
5.3.80.0050.03812.09
5.3.70.0080.03912.10
5.3.60.0070.03912.08
5.3.50.0050.04012.03
5.3.40.0040.03712.03
5.3.30.0060.03411.99
5.3.20.0070.03611.77
5.3.10.0070.03511.74
5.3.00.0050.04011.72
5.2.170.0030.0359.22
5.2.160.0030.0309.22
5.2.150.0060.0289.23
5.2.140.0060.0359.22
5.2.130.0040.0299.18
5.2.120.0050.0359.18
5.2.110.0100.0289.20
5.2.100.0070.0259.19
5.2.90.0070.0269.19
5.2.80.0000.0349.18
5.2.70.0080.0289.18
5.2.60.0070.0339.13
5.2.50.0060.0309.10
5.2.40.0040.0359.08
5.2.30.0050.0309.06
5.2.20.0050.0299.05
5.2.10.0030.0288.95
5.2.00.0030.0298.82
5.1.60.0090.0238.10
5.1.50.0020.0268.09
5.1.40.0050.0298.07
5.1.30.0030.0328.43
5.1.20.0050.0308.44
5.1.10.0090.0258.17
5.1.00.0040.0288.17
5.0.50.0050.0206.66
5.0.40.0050.0176.52
5.0.30.0050.0296.32
5.0.20.0030.0196.29
5.0.10.0030.0196.27
5.0.00.0030.0326.27
4.4.90.0010.0174.77
4.4.80.0020.0164.76
4.4.70.0030.0144.75
4.4.60.0010.0164.75
4.4.50.0030.0144.77
4.4.40.0050.0234.71
4.4.30.0040.0134.76
4.4.20.0040.0144.85
4.4.10.0020.0184.85
4.4.00.0000.0274.76
4.3.110.0010.0174.67
4.3.100.0050.0144.66
4.3.90.0020.0254.64
4.3.80.0020.0334.58
4.3.70.0040.0174.63
4.3.60.0040.0194.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0010.0183.30
4.3.20.0020.0153.28
4.3.10.0040.0133.24
4.3.00.0100.0276.73

preferences:
93.8 ms | 400 KiB | 5 Q