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'); } } var_dump(new Money(55) == true); var_dump(new Money(55) === true); // $currency is passed in, $currency == true $revenue = new Money(55, new Currency('GBP')); var_dump($revenue->currency->equals(new Currency('GBP'))); // $currency is null, $currency == false $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.0150.00618.43
8.3.50.0080.01322.07
8.3.40.0100.01018.71
8.3.30.0100.00319.27
8.3.20.0050.00320.39
8.3.10.0040.00420.57
8.3.00.0080.00019.68
8.2.180.0070.01516.35
8.2.170.0070.00722.96
8.2.160.0030.01020.24
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00222.27
8.2.110.0090.00022.07
8.2.100.0100.00017.72
8.2.90.0040.00419.21
8.2.80.0030.00517.97
8.2.70.0040.00417.38
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0000.01218.09
8.2.30.0000.00819.27
8.2.20.0000.00717.70
8.2.10.0040.00418.14
8.2.00.0040.00417.69
8.1.280.0030.01725.92
8.1.270.0080.00022.18
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0000.01124.01
8.1.230.0070.00419.08
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00717.48
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00918.46
8.1.160.0040.00421.94
8.1.150.0030.00519.01
8.1.140.0040.00417.46
8.1.130.0000.00717.76
8.1.120.0070.00017.52
8.1.110.0000.00717.51
8.1.100.0000.00817.38
8.1.90.0030.00317.34
8.1.80.0000.00717.42
8.1.70.0030.00317.45
8.1.60.0040.00417.58
8.1.50.0000.00817.44
8.1.40.0040.00417.54
8.1.30.0030.00617.64
8.1.20.0050.00317.69
8.1.10.0050.00317.47
8.1.00.0130.00017.49
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0030.00318.53
8.0.270.0080.00017.16
8.0.260.0030.00317.32
8.0.250.0030.00316.95
8.0.240.0000.00816.93
8.0.230.0070.00016.94
8.0.220.0000.00716.95
8.0.210.0000.00716.86
8.0.200.0000.00716.95
8.0.190.0060.00616.93
8.0.180.0030.00616.96
8.0.170.0030.00516.89
8.0.160.0000.00716.84
8.0.150.0030.00317.00
8.0.140.0050.00316.88
8.0.130.0030.00313.36
8.0.120.0030.00616.95
8.0.110.0070.00016.88
8.0.100.0050.00316.88
8.0.90.0000.00716.85
8.0.80.0120.00617.03
8.0.70.0040.00416.77
8.0.60.0040.00416.99
8.0.50.0000.00716.99
8.0.30.0130.00717.04
8.0.20.0100.01017.40
8.0.10.0070.00016.96
8.0.00.0030.01416.67
7.4.330.0050.00015.14
7.4.320.0040.00416.63
7.4.300.0030.00316.67
7.4.290.0030.00316.67
7.4.280.0050.00316.65
7.4.270.0030.00316.52
7.4.260.0070.00016.68
7.4.250.0070.00016.59
7.4.240.0040.00416.60
7.4.230.0000.00716.70
7.4.220.0070.01016.67
7.4.210.0030.01216.59
7.4.200.0050.00316.69
7.4.160.0080.00816.55
7.4.150.0060.01717.40
7.4.140.0100.00717.86
7.4.130.0100.01216.48
7.4.120.0110.00616.46
7.4.110.0060.01116.68
7.4.100.0100.00816.59
7.4.90.0100.00716.36
7.4.80.0100.00716.49
7.4.70.0100.00716.52
7.4.60.0120.00816.46
7.4.50.0030.00616.46
7.4.40.0030.01316.60
7.4.30.0130.00316.66
7.4.00.0070.01015.05
7.3.330.0050.00013.20
7.3.320.0030.00313.34
7.3.310.0000.00716.34
7.3.300.0030.00316.33
7.3.290.0110.00316.39
7.3.280.0060.00816.41
7.3.270.0060.01317.40
7.3.260.0140.00616.57
7.3.250.0080.01116.40
7.3.240.0070.01416.57
7.3.230.0140.00416.54
7.3.210.0070.01016.43
7.3.200.0130.00919.39
7.3.190.0090.01216.71
7.3.180.0090.00616.65
7.3.170.0060.00916.54
7.3.160.0030.01216.65
7.3.120.0070.01315.02
7.3.110.0070.01014.80
7.3.100.0060.01514.60
7.3.90.0040.00814.83
7.3.80.0060.00914.43
7.3.70.0040.00714.82
7.3.60.0030.00714.78
7.3.50.0090.00614.80
7.3.40.0000.00914.71
7.3.30.0080.00414.64
7.3.20.0060.00916.48
7.3.10.0100.00716.46
7.3.00.0060.00616.67
7.2.330.0090.00916.86
7.2.320.0070.01116.73
7.2.310.0080.00916.64
7.2.300.0120.00916.90
7.2.290.0030.01316.61
7.2.250.0030.01415.09
7.2.240.0070.01415.06
7.2.230.0120.00315.11
7.2.220.0060.00915.32
7.2.210.0090.00314.66
7.2.200.0130.00315.18
7.2.190.0030.01215.31
7.2.180.0140.00015.25
7.2.170.0070.00315.16
7.2.160.0000.01415.02
7.2.150.0000.01316.71
7.2.140.0050.00516.97
7.2.130.0060.00816.79
7.2.120.0090.00616.81
7.2.110.0120.00216.84
7.2.100.0060.00716.92
7.2.90.0080.00617.07
7.2.80.0110.00316.91
7.2.70.0090.00616.80
7.2.60.0080.00616.85
7.2.50.0110.00516.88
7.2.40.0090.00516.91
7.2.30.0060.00916.94
7.2.20.0080.00716.80
7.2.10.0050.00816.95
7.2.00.0050.00817.73
7.1.330.0090.00915.91
7.1.320.0000.01015.82
7.1.310.0090.00615.84
7.1.300.0120.00415.68
7.1.290.0040.01115.87
7.1.280.0000.01315.73
7.1.270.0090.00615.66
7.1.260.0080.00015.87
7.1.250.0130.00315.88
7.1.240.0080.00715.68
7.1.230.0080.00415.61
7.1.220.0080.00515.58
7.1.210.0050.00715.88
7.1.200.0090.00515.73
7.1.190.0050.00815.81
7.1.180.0050.01115.75
7.1.170.0090.00715.65
7.1.160.0060.00615.71
7.1.150.0100.00515.72
7.1.140.0060.00815.79
7.1.130.0030.00915.69
7.1.120.0070.00715.53
7.1.110.0100.00415.75
7.1.100.0360.00915.84
7.1.90.0080.00615.71
7.1.80.0110.00415.81
7.1.70.0020.01116.29
7.1.60.0060.01116.83
7.1.50.0070.01116.10
7.1.40.0060.00915.59
7.1.30.0110.00415.71
7.1.20.0070.00815.65
7.1.10.0110.00515.89
7.1.00.0060.02918.00
7.0.330.0090.00715.25
7.0.320.0050.00815.43
7.0.310.0060.00915.27
7.0.300.0110.00515.47
7.0.290.0050.00715.29
7.0.280.0070.00715.27
7.0.270.0080.00815.45
7.0.260.0040.00715.26
7.0.250.0080.00515.29
7.0.240.0090.00515.23
7.0.230.0080.00615.50
7.0.220.0080.00815.52
7.0.210.0100.00715.45
7.0.200.0120.00215.88
7.0.190.0070.00515.37
7.0.180.0070.00815.22
7.0.170.0080.00315.26
7.0.160.0050.00615.28
7.0.150.0060.00815.36
7.0.140.0010.03417.47
7.0.130.0090.00815.37
7.0.120.0070.00715.37
7.0.110.0050.00915.26
7.0.100.0030.00915.44
7.0.90.0080.00815.53
7.0.80.0100.00715.40
7.0.70.0040.00815.44
7.0.60.0100.03016.90
7.0.50.0070.02916.34
7.0.40.0060.02215.59
7.0.30.0100.02415.67
7.0.20.0110.03315.69
7.0.10.0060.03415.63
7.0.00.0030.02015.63
5.6.400.0110.00014.33
5.6.390.0060.00314.73
5.6.380.0040.00914.48
5.6.370.0030.00514.46
5.6.360.0030.01014.35
5.6.350.0030.01014.35
5.6.340.0080.00714.46
5.6.330.0060.00614.44
5.6.320.0050.00914.41
5.6.310.0050.00814.50
5.6.300.0060.00514.35
5.6.290.0070.00814.35
5.6.280.0080.02716.53
5.6.270.0080.00614.27
5.6.260.0120.00614.50
5.6.250.0080.01114.40
5.6.240.0050.01214.49
5.6.230.0080.00814.32
5.6.220.0090.00914.27
5.6.210.0150.02416.59
5.6.200.0060.02015.78
5.6.190.0060.02116.40
5.6.180.0250.02616.55
5.6.170.0120.01816.36
5.6.160.0070.02816.31
5.6.150.0070.03415.61
5.6.140.0100.02415.62
5.6.130.0050.03715.59
5.6.120.0080.02216.66
5.6.110.0060.02116.49
5.6.100.0070.03716.55
5.6.90.0070.03316.50
5.6.80.0100.03216.31
5.6.70.0110.00614.13
5.6.60.0080.00714.34
5.6.50.0070.00914.15
5.6.40.0140.00714.22
5.6.30.0080.00814.46
5.6.20.0090.00614.29
5.6.10.0060.01014.14
5.6.00.0090.01014.34
5.5.380.0090.00512.86
5.5.370.0080.00512.72
5.5.360.0070.00712.56
5.5.350.0100.02815.30
5.5.340.0040.02014.55
5.5.330.0070.01715.27
5.5.320.0170.02715.34
5.5.310.0090.02115.34
5.5.300.0030.01814.48
5.5.290.0040.03414.49
5.5.280.0060.03215.46
5.5.270.0070.02315.41
5.5.260.0050.01615.44
5.5.250.0080.02915.38
5.5.240.0110.02515.29
5.5.230.0040.00812.59
5.5.220.0040.00612.61
5.5.210.0090.00312.57
5.5.200.0030.01012.55
5.5.190.0080.00512.46
5.5.180.0040.00712.72
5.5.170.0070.00712.85
5.5.160.0030.00912.54
5.5.150.0010.00912.43
5.5.140.0040.00712.58
5.5.130.0050.00612.70
5.5.120.0090.00412.69
5.5.110.0030.00812.59
5.5.100.0030.00812.55
5.5.90.0050.00812.79
5.5.80.0030.01012.89
5.5.70.0030.00812.66
5.5.60.0050.01012.53
5.5.50.0030.00712.78
5.5.40.0030.00812.68
5.5.30.0050.00812.74
5.5.20.0070.00612.69
5.5.10.0030.00912.55
5.5.00.0040.00712.42
5.4.450.0060.02413.87
5.4.440.0380.02913.74
5.4.430.0270.02314.02
5.4.420.0350.01914.09
5.4.410.0320.01913.80
5.4.400.0270.02013.58
5.4.390.0330.02213.89
5.4.380.0090.02613.52
5.4.370.0130.02013.54
5.4.360.0180.02413.56
5.4.350.0130.02313.69
5.4.340.0200.01613.59
5.4.330.0040.00811.11
5.4.320.0060.01811.59
5.4.310.0050.01911.50
5.4.300.0050.01611.47
5.4.290.0040.01911.61
5.4.280.0050.01611.34
5.4.270.0070.01511.57
5.4.260.0060.01611.51
5.4.250.0080.01411.50
5.4.240.0020.02011.36
5.4.230.0040.02011.51
5.4.220.0040.01611.46
5.4.210.0060.01611.53
5.4.200.0020.01811.42
5.4.190.0030.01811.33
5.4.180.0030.01811.45
5.4.170.0070.01511.35
5.4.160.0070.01411.41
5.4.150.0070.01311.50
5.4.140.0050.01511.32
5.4.130.0060.01511.29
5.4.120.0020.01811.30
5.4.110.0070.01511.21
5.4.100.0050.01511.34
5.4.90.0050.01811.13
5.4.80.0050.01911.25
5.4.70.0030.01711.37
5.4.60.0050.01511.32
5.4.50.0030.01911.36
5.4.40.0080.01311.20
5.4.30.0040.01611.30
5.4.20.0060.01411.27
5.4.10.0050.01711.24
5.4.00.0050.01611.12
5.3.290.0090.02111.75
5.3.280.0080.02411.68
5.3.270.0060.02211.64
5.3.260.0040.02611.71
5.3.250.0110.02011.70
5.3.240.0070.02011.55
5.3.230.0040.02111.65
5.3.220.0080.02011.57
5.3.210.0080.02411.56
5.3.200.0080.02011.62
5.3.190.0060.02111.58
5.3.180.0040.02411.63
5.3.170.0060.02111.63
5.3.160.0050.02111.70
5.3.150.0070.01811.65
5.3.140.0040.02211.51
5.3.130.0020.02511.62
5.3.120.0060.02011.61
5.3.110.0040.02911.51
5.3.100.0080.02211.28
5.3.90.0070.01811.35
5.3.80.0070.02311.21
5.3.70.0120.01811.27
5.3.60.0040.02211.15
5.3.50.0080.02211.27
5.3.40.0100.02011.26
5.3.30.0080.01611.32
5.3.20.0090.01811.24
5.3.10.0070.01911.04
5.3.00.0040.02310.94
5.2.170.0070.0159.59
5.2.160.0090.0139.59
5.2.150.0090.0149.59
5.2.140.0080.0179.59
5.2.130.0060.0189.57
5.2.120.0080.0159.57
5.2.110.0060.0199.58
5.2.100.0020.0209.57
5.2.90.0060.0169.57
5.2.80.0090.0179.57
5.2.70.0070.0179.57
5.2.60.0070.0189.55
5.2.50.0040.0199.53
5.2.40.0050.0189.52
5.2.30.0070.0159.51
5.2.20.0040.0189.50
5.2.10.0060.0149.46
5.2.00.0050.0199.39
5.1.60.0040.0149.03
5.1.50.0020.0189.03
5.1.40.0090.0149.02
5.1.30.0050.0159.19
5.1.20.0030.0229.20
5.1.10.0040.0179.06
5.1.00.0030.0179.06
5.0.50.0060.0138.30
5.0.40.0040.0168.23
5.0.30.0040.0228.14
5.0.20.0040.0128.13
5.0.10.0040.0138.12
5.0.00.0020.0198.11
4.4.90.0020.0097.37
4.4.80.0020.0097.36
4.4.70.0040.0077.36
4.4.60.0020.0107.36
4.4.50.0010.0127.37
4.4.40.0030.0157.33
4.4.30.0050.0087.36
4.4.20.0030.0087.40
4.4.10.0050.0087.40
4.4.00.0030.0147.36
4.3.110.0010.0127.31
4.3.100.0040.0087.31
4.3.90.0010.0107.30
4.3.80.0030.0167.27
4.3.70.0050.0077.29
4.3.60.0050.0087.29
4.3.50.0030.0097.29
4.3.40.0020.0147.25
4.3.30.0030.0086.63
4.3.20.0040.0106.62
4.3.10.0030.0106.60
4.3.00.0040.0148.35

preferences:
33.91 ms | 401 KiB | 5 Q