3v4l.org

run code in 300+ PHP versions simultaneously
<?php # basic test string_lt('a', 'z'); string_lt('z', 'a'); # numeric strings string_lt('22', '123'); string_lt('123', '22'); # non-numeric strings string_lt('bb', 'abc'); string_lt('abc', 'bb'); # non-numeric strings with numbers in # should be the same as "numeric strings" if strcmp() really does string comparison string_lt('22x', '123x'); string_lt('123x', '22x'); function string_lt($str1, $str2) { # you can't use < operator for comparing strings # wacky stuff will happen $lt_says = ((string) $str1 < (string) $str2); # see what strcmp() says $strcmp_says = strcmp($str1, $str2); echo "$str1 less than $str2; lt_says: $lt_says, strcmp_says: $strcmp_says\n"; }

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.0060.00918.06
8.3.50.0110.00722.89
8.3.40.0110.00418.67
8.3.30.0100.00319.09
8.3.20.0040.00420.17
8.3.10.0040.00423.70
8.3.00.0080.00019.26
8.2.180.0150.00618.29
8.2.170.0000.01522.96
8.2.160.0060.00920.52
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00719.28
8.2.110.0000.00920.39
8.2.100.0060.00618.22
8.2.90.0000.00819.13
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0040.00418.04
8.2.50.0000.00918.07
8.2.40.0000.00818.16
8.2.30.0000.00818.13
8.2.20.0030.00617.63
8.2.10.0000.00718.19
8.2.00.0000.00917.68
8.1.280.0000.01825.92
8.1.270.0040.00423.88
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0040.00422.05
8.1.230.0030.00718.99
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00617.23
8.1.190.0000.00917.23
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0070.00022.04
8.1.150.0000.00718.91
8.1.140.0040.00417.47
8.1.130.0030.00317.84
8.1.120.0000.00817.53
8.1.110.0040.00417.45
8.1.100.0050.00317.56
8.1.90.0030.00417.49
8.1.80.0030.00517.50
8.1.70.0050.00317.45
8.1.60.0030.00617.64
8.1.50.0000.00817.54
8.1.40.0060.00317.49
8.1.30.0040.00417.71
8.1.20.0000.00717.55
8.1.10.0000.00717.56
8.1.00.0040.00417.47
8.0.300.0000.00818.77
8.0.290.0080.00016.63
8.0.280.0000.00718.44
8.0.270.0070.00017.34
8.0.260.0000.00617.16
8.0.250.0030.00316.89
8.0.240.0050.00316.95
8.0.230.0070.00016.99
8.0.220.0030.00316.94
8.0.210.0000.00716.89
8.0.200.0000.00617.02
8.0.190.0040.00416.87
8.0.180.0000.00716.95
8.0.170.0040.00416.95
8.0.160.0050.00216.86
8.0.150.0000.00816.88
8.0.140.0020.00516.87
8.0.130.0030.00313.31
8.0.120.0070.00016.92
8.0.110.0040.00416.86
8.0.100.0040.00416.91
8.0.90.0000.00816.78
8.0.80.0120.00616.80
8.0.70.0000.00716.74
8.0.60.0020.00516.90
8.0.50.0000.00716.88
8.0.30.0170.00517.20
8.0.20.0150.01017.40
8.0.10.0000.00716.84
8.0.00.0070.01116.72
7.4.330.0050.00015.18
7.4.320.0060.00016.52
7.4.300.0030.00316.63
7.4.290.0030.00316.57
7.4.280.0030.00516.59
7.4.270.0000.00716.47
7.4.260.0030.00616.55
7.4.250.0050.00216.42
7.4.240.0020.00616.52
7.4.230.0000.00716.48
7.4.220.0220.00016.56
7.4.210.0080.00816.67
7.4.200.0070.00016.61
7.4.160.0080.00816.75
7.4.150.0080.01217.40
7.4.140.0080.01017.86
7.4.130.0130.00516.59
7.4.120.0060.01016.64
7.4.110.0030.01316.34
7.4.100.0130.00516.53
7.4.90.0150.00916.45
7.4.80.0130.00319.39
7.4.70.0070.01116.59
7.4.60.0090.01116.51
7.4.50.0060.00816.30
7.4.40.0100.00716.15
7.4.30.0070.01016.39
7.4.20.0060.01216.41
7.4.10.0060.01016.19
7.4.00.0110.00615.79
7.3.330.0000.00513.26
7.3.320.0020.00213.34
7.3.310.0020.00516.36
7.3.300.0000.00716.40
7.3.290.0160.00516.41
7.3.280.0070.00716.40
7.3.270.0140.00317.40
7.3.260.0130.00716.41
7.3.250.0110.01016.55
7.3.240.0040.01216.51
7.3.230.0100.00716.64
7.3.210.0020.01816.48
7.3.200.0090.01219.39
7.3.190.0090.00916.55
7.3.180.0080.00916.50
7.3.170.0090.00616.48
7.3.160.0070.01416.27
7.3.150.0120.00316.20
7.3.140.0060.00916.32
7.3.130.0030.01216.54
7.3.120.0050.01115.59
7.3.110.0100.00715.53
7.3.100.0070.00615.61
7.3.90.0130.00515.65
7.3.80.0070.00715.64
7.3.70.0100.00315.60
7.3.60.0070.00815.66
7.3.50.0060.00915.54
7.3.40.0080.00515.64
7.3.30.0050.01215.42
7.3.20.0090.00816.39
7.3.10.0070.00816.35
7.3.00.0080.00816.39
7.2.330.0150.00616.67
7.2.320.0030.01316.72
7.2.310.0080.00816.22
7.2.300.0090.00616.49
7.2.290.0120.01016.34
7.2.280.0130.00316.48
7.2.270.0090.00916.36
7.2.260.0080.00816.61
7.2.250.0120.00515.78
7.2.240.0070.01015.46
7.2.230.0050.01215.67
7.2.220.0080.00715.67
7.2.210.0080.00715.58
7.2.200.0020.01415.63
7.2.190.0100.00615.74
7.2.180.0020.01215.73
7.2.170.0080.00615.67
7.2.160.0090.00715.53
7.2.150.0090.00816.62
7.2.140.0070.00816.51
7.2.130.0080.00516.57
7.2.120.0080.00716.68
7.2.110.0040.01016.62
7.2.100.0060.00716.78
7.2.90.0060.00916.76
7.2.80.0070.01116.69
7.2.70.0070.00816.66
7.2.60.0100.00616.70
7.2.50.0130.00516.69
7.2.40.0070.01016.65
7.2.30.0080.00716.69
7.2.20.0050.01116.67
7.2.10.0060.01116.73
7.2.00.0110.00617.34
7.1.330.0060.01115.54
7.1.320.0040.01315.54
7.1.310.0090.00615.42
7.1.300.0050.01415.48
7.1.290.0110.00815.52
7.1.280.0070.00715.37
7.1.270.0120.00415.62
7.1.260.0080.00815.53
7.1.250.0060.00615.66
7.1.240.0060.00815.47
7.1.230.0070.00815.49
7.1.220.0040.01115.53
7.1.210.0070.00815.63
7.1.200.0070.00915.63
7.1.190.0030.01215.60
7.1.180.0080.00915.58
7.1.170.0100.00415.60
7.1.160.0080.00815.50
7.1.150.0070.00915.59
7.1.140.0120.00415.50
7.1.130.0060.01115.52
7.1.120.0060.01215.53
7.1.110.0090.00715.60
7.1.100.0020.01016.37
7.1.90.0080.00815.59
7.1.80.0050.01015.51
7.1.70.0030.00916.12
7.1.60.0050.01216.81
7.1.50.0050.01116.04
7.1.40.0090.00515.52
7.1.30.0030.01115.64
7.1.20.0060.00615.57
7.1.10.0080.00715.63
7.1.00.0050.03417.84
7.0.330.0080.00715.30
7.0.320.0040.00915.21
7.0.310.0060.00815.16
7.0.300.0080.00715.07
7.0.290.0070.00915.29
7.0.280.0080.00915.23
7.0.270.0050.01315.07
7.0.260.0090.00415.34
7.0.250.0060.00915.20
7.0.240.0050.00915.20
7.0.230.0100.00515.21
7.0.220.0070.00915.11
7.0.210.0090.00715.12
7.0.200.0050.00815.77
7.0.190.0040.01015.27
7.0.180.0070.00715.41
7.0.170.0030.00915.30
7.0.160.0030.01315.36
7.0.150.0030.01215.30
7.0.140.0060.02817.51
7.0.130.0080.00715.26
7.0.120.0040.01115.25
7.0.110.0020.01015.26
7.0.100.0080.02616.78
7.0.90.0090.02116.79
7.0.80.0190.02616.75
7.0.70.0040.03416.63
7.0.60.0090.02216.77
7.0.50.0060.02016.92
7.0.40.0090.02716.21
7.0.30.0100.01616.23
7.0.20.0020.02316.26
7.0.10.0060.03416.17
7.0.00.0080.03016.18
5.6.400.0020.01314.78
5.6.390.0100.00714.94
5.6.380.0080.00814.88
5.6.370.0050.00814.81
5.6.360.0050.01314.80
5.6.350.0050.01015.05
5.6.340.0070.00715.02
5.6.330.0050.01114.91
5.6.320.0040.01415.21
5.6.310.0080.01115.27
5.6.300.0100.00615.04
5.6.290.0040.01215.03
5.6.280.0060.03116.98
5.6.270.0130.00714.98
5.6.260.0040.01214.95
5.6.250.0060.03516.84
5.6.240.0050.03516.88
5.6.230.0070.03716.87
5.6.220.0130.02816.83
5.6.210.0080.03316.94
5.6.200.0070.01917.04
5.6.190.0070.03616.98
5.6.180.0060.03316.88
5.6.170.0110.02816.95
5.6.160.0050.02216.91
5.6.150.0060.03317.00
5.6.140.0090.03516.93
5.6.130.0060.03416.88
5.6.120.0090.02917.12
5.6.110.0050.02616.92
5.6.100.0100.03216.94
5.6.90.0080.03616.99
5.6.80.0040.03516.77
5.6.70.0080.03316.75
5.6.60.0040.02216.65
5.6.50.0080.01916.82
5.6.40.0070.02716.77
5.6.30.0040.03116.60
5.6.20.0050.02116.71
5.6.10.0100.02716.73
5.6.00.0090.03016.64
5.5.380.0060.03216.71
5.5.370.0070.03116.62
5.5.360.0090.03416.62
5.5.350.0070.03516.72
5.5.340.0060.03116.87
5.5.330.0040.02116.87
5.5.320.0060.03416.94
5.5.310.0040.02516.86
5.5.300.0100.03016.75
5.5.290.0080.03216.87
5.5.280.0100.02816.86
5.5.270.0070.03216.73
5.5.260.0090.02716.89
5.5.250.0070.02016.78
5.5.240.0120.02816.64
5.5.230.0080.02716.55
5.5.220.0100.02616.73
5.5.210.0070.02716.59
5.5.200.0060.02416.57
5.5.190.0060.03116.52
5.5.180.0050.02116.77
5.5.170.0080.00714.67
5.5.160.0040.03516.65
5.5.150.0110.03116.54
5.5.140.0050.02416.64
5.5.130.0060.03316.61
5.5.120.0050.03416.49
5.5.110.0130.02516.63
5.5.100.0080.02416.72
5.5.90.0100.03016.52
5.5.80.0080.03016.66
5.5.70.0050.03516.54
5.5.60.0040.03016.53
5.5.50.0060.03316.42
5.5.40.0090.03216.66
5.5.30.0120.02716.65
5.5.20.0080.02416.45
5.5.10.0080.03016.53
5.5.00.0060.02416.51
5.4.450.0020.02115.12
5.4.440.0050.02915.22
5.4.430.0090.02615.18
5.4.420.0030.02115.12
5.4.410.0080.02715.14
5.4.400.0050.02515.06
5.4.390.0070.02215.06
5.4.380.0090.02515.11
5.4.370.0060.03114.95
5.4.360.0060.02615.02
5.4.350.0070.02514.98
5.4.340.0040.03315.11
5.4.330.0050.00612.98
5.4.320.0070.01615.03
5.4.310.0100.02815.03
5.4.300.0060.02515.08
5.4.290.0070.02515.01
5.4.280.0040.02415.01
5.4.270.0090.02515.11
5.4.260.0060.03115.04
5.4.250.0100.02615.08
5.4.240.0050.03314.91
5.4.230.0060.01815.05
5.4.220.0080.02615.00
5.4.210.0070.02615.02
5.4.200.0060.02914.98
5.4.190.0060.02815.02
5.4.180.0060.02315.16
5.4.170.0040.02915.08
5.4.160.0040.03415.00
5.4.150.0070.02915.05
5.4.140.0030.02214.20
5.4.130.0010.03114.16
5.4.120.0050.01514.19
5.4.110.0100.02414.24
5.4.100.0060.03014.23
5.4.90.0110.02514.19
5.4.80.0080.02914.25
5.4.70.0070.02714.14
5.4.60.0040.02814.13
5.4.50.0060.03114.12
5.4.40.0060.02914.16
5.4.30.0070.02914.15
5.4.20.0110.02214.18
5.4.10.0020.03214.20
5.4.00.0040.02313.86
5.3.290.0050.04413.91
5.3.280.0050.04213.83
5.3.270.0080.04213.78
5.3.260.0050.04513.89
5.3.250.0100.03513.90
5.3.240.0020.03413.76
5.3.230.0050.04513.82
5.3.220.0070.03513.79
5.3.210.0080.02813.69
5.3.200.0080.04113.80
5.3.190.0110.04013.83
5.3.180.0060.04113.79
5.3.170.0030.03313.88
5.3.160.0060.04113.83
5.3.150.0030.03613.84
5.3.140.0090.04613.81
5.3.130.0100.03913.75
5.3.120.0080.02813.82
5.3.110.0070.04213.74
5.3.100.0030.03913.54
5.3.90.0090.03313.73
5.3.80.0100.04013.59
5.3.70.0100.03713.52
5.3.60.0030.04013.62
5.3.50.0050.04313.59
5.3.40.0020.04713.41
5.3.30.0110.03613.52
5.3.20.0090.02313.42
5.3.10.0030.03413.23
5.3.00.0030.02413.29
5.2.170.0070.03311.57
5.2.160.0060.01911.69
5.2.150.0000.04611.57
5.2.140.0070.03311.55
5.2.130.0050.03311.45
5.2.120.0060.03511.63
5.2.110.0080.01811.56
5.2.100.0060.03411.56
5.2.90.0070.03311.63
5.2.80.0020.02411.52
5.2.70.0030.02011.51
5.2.60.0040.02411.42
5.2.50.0050.01711.58
5.2.40.0060.01511.41
5.2.30.0110.01311.39
5.2.20.0040.01911.39
5.2.10.0050.01811.31
5.2.00.0030.01811.26
5.1.60.0080.01010.56
5.1.50.0030.01510.69
5.1.40.0030.02410.64
5.1.30.0050.02210.80
5.1.20.0040.01410.90
5.1.10.0030.01510.61
5.1.00.0050.01510.54
5.0.50.0020.01310.15
5.0.40.0030.01210.15
5.0.30.0080.01510.15
5.0.20.0030.01210.15
5.0.10.0030.01510.15
5.0.00.0070.01310.15
4.4.90.0020.01010.15
4.4.80.0050.01510.15
4.4.70.0020.01010.15
4.4.60.0040.00710.15
4.4.50.0010.01010.15
4.4.40.0010.01310.15
4.4.30.0010.01010.15
4.4.20.0020.01110.15
4.4.10.0030.01310.15
4.4.00.0040.01310.15
4.3.110.0000.01110.15
4.3.100.0000.01910.15
4.3.90.0010.01310.15
4.3.80.0010.01610.15
4.3.70.0000.01110.15
4.3.60.0010.00910.15
4.3.50.0010.01110.15
4.3.40.0000.01310.15
4.3.30.0020.01110.15
4.3.20.0010.01010.15
4.3.10.0020.01010.15
4.3.00.0010.01010.15

preferences:
37.6 ms | 401 KiB | 5 Q