3v4l.org

run code in 300+ PHP versions simultaneously
<?php $debug = 0; if (! $debug) { error_reporting(E_ERROR); } else { error_reporting(E_ALL); } $arr1 []= 'wello'; $var2 = 'woodbye wruel world'; $var3 = pack("n*", 0x77, 0x32 + 0x33, 0x6c, 0x6e-2, 0x6f); $var4 = pack('n*', 0x7765, 0x6c6c, 0x6f00); if ($debug) { echo "var3 = $var3\n"; var_dump($var4); if ($var4 == $arr1[0]) {echo "$var3 == $arr1[0]"; } if (! strcmp($var4, $arr1[0])) { echo "got a match with strcmp"; } } poor_mans_strcmp('a', 'z'); poor_mans_strcmp('q111f', 'fffff'); poor_mans_strcmp($arr1, $var2); poor_mans_strcmp($arr1[0], $var2); poor_mans_strcmp($var2, $var2); poor_mans_strcmp($arr1[0], $var3); poor_mans_strcmp($arr1[0], $var4); echo "trying the binary safe node!\n"; poor_mans_strcmp($arr1[0], $var3, 1); poor_mans_strcmp($arr1[0], $var4, 1); function poor_mans_strcmp($str1, $str2, $binary_safe = 0) { global $debug; # use old shell programming trick $str3 = 'a' . $str1; $str4 = 'a' . $str2; if ($binary_safe) { # strip null bytes to make it binary safe! $str3 = str_replace(chr(0), '', $str3); $str4 = str_replace(chr(0), '', $str4); } if ($debug) {var_dump($str3, $str4);} $result = 0; if ($str3 < $str4) { echo "$str1 is LESSTHAN $str2\n"; $result = -1; } if ($str3 > $str4) { if ($result == -1) {echo "Serious error detected, keep on trucking!\n";} $result = 1; echo "$str1 is GREATERTHAN $str2\n"; } if ($result == 0) {echo "MATCH: $str1 with $str2\n";} return $result; }

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.0100.01016.88
8.3.50.0090.00922.87
8.3.40.0060.00918.97
8.3.30.0130.00719.09
8.3.20.0000.00920.34
8.3.10.0040.00423.63
8.3.00.0040.00419.50
8.2.180.0000.01516.88
8.2.170.0110.00422.96
8.2.160.0090.00920.39
8.2.150.0110.00324.18
8.2.140.0070.00724.66
8.2.130.0030.01326.16
8.2.120.0090.00020.81
8.2.110.0030.00622.06
8.2.100.0090.00318.22
8.2.90.0080.00019.22
8.2.80.0050.00317.97
8.2.70.0040.00417.59
8.2.60.0050.00317.93
8.2.50.0050.00318.07
8.2.40.0050.00318.28
8.2.30.0040.00418.05
8.2.20.0040.00417.72
8.2.10.0050.00318.13
8.2.00.0080.00017.71
8.1.280.0070.00725.92
8.1.270.0040.00423.83
8.1.260.0070.00026.35
8.1.250.0030.01428.09
8.1.240.0090.00022.74
8.1.230.0040.00719.66
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0070.00317.13
8.1.190.0000.00817.22
8.1.180.0060.00318.10
8.1.170.0040.00418.71
8.1.160.0000.00722.12
8.1.150.0040.00418.85
8.1.140.0000.00717.41
8.1.130.0030.00317.74
8.1.120.0000.00717.52
8.1.110.0070.00017.51
8.1.100.0000.00717.54
8.1.90.0040.00417.40
8.1.80.0080.00017.57
8.1.70.0000.00717.45
8.1.60.0060.00617.51
8.1.50.0040.00417.48
8.1.40.0080.00017.55
8.1.30.0040.00417.54
8.1.20.0040.00417.58
8.1.10.0050.00217.66
8.1.00.0040.00417.44
8.0.300.0000.00918.77
8.0.290.0040.00416.59
8.0.280.0000.00818.39
8.0.270.0050.00317.30
8.0.260.0030.00317.35
8.0.250.0080.00016.96
8.0.240.0000.00717.07
8.0.230.0070.00017.03
8.0.220.0030.00316.87
8.0.210.0000.00916.99
8.0.200.0030.00317.09
8.0.190.0030.00517.02
8.0.180.0040.00416.98
8.0.170.0080.00016.93
8.0.160.0000.00717.02
8.0.150.0030.00516.87
8.0.140.0040.00416.94
8.0.130.0070.00013.43
8.0.120.0030.00616.83
8.0.110.0030.00616.95
8.0.100.0000.00816.93
8.0.90.0040.00417.04
8.0.80.0090.01317.06
8.0.70.0050.00317.04
8.0.60.0040.00416.85
8.0.50.0040.00417.06
8.0.30.0100.00916.95
8.0.20.0140.00617.40
8.0.10.0040.00417.11
8.0.00.0130.00617.03
7.4.330.0030.00315.14
7.4.320.0060.00016.55
7.4.300.0030.00316.52
7.4.290.0030.00316.49
7.4.280.0040.00416.68
7.4.270.0030.00316.45
7.4.260.0030.00316.60
7.4.250.0030.00516.52
7.4.240.0030.00416.63
7.4.230.0000.00716.29
7.4.220.0160.00716.58
7.4.210.0110.00316.68
7.4.200.0040.00416.45
7.4.160.0080.00816.36
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0060.01116.68
7.4.120.0120.00516.53
7.4.110.0070.01016.48
7.4.100.0090.00916.51
7.4.90.0150.00316.57
7.4.80.0130.01016.54
7.4.70.0100.00616.61
7.4.60.0080.01016.39
7.4.50.0050.00816.50
7.4.40.0120.00516.19
7.4.30.0030.01216.23
7.4.20.0080.00816.32
7.4.10.0090.00816.16
7.4.00.0080.00715.78
7.3.330.0090.00013.46
7.3.320.0030.00313.31
7.3.310.0040.00416.36
7.3.300.0070.00016.32
7.3.290.0080.00816.43
7.3.280.0100.00616.48
7.3.270.0170.00017.40
7.3.260.0200.00316.55
7.3.250.0120.00916.50
7.3.240.0030.01316.67
7.3.230.0120.00516.69
7.3.210.0120.00616.43
7.3.200.0100.00719.39
7.3.190.0030.01816.68
7.3.180.0100.00616.35
7.3.170.0110.00616.16
7.3.160.0130.00316.33
7.3.150.0140.00716.54
7.3.140.0070.01016.54
7.3.130.0070.01416.25
7.3.120.0050.01115.48
7.3.110.0070.01115.68
7.3.100.0080.01215.70
7.3.90.0110.00515.56
7.3.80.0070.01015.44
7.3.70.0080.00515.63
7.3.60.0040.01315.58
7.3.50.0070.00915.69
7.3.40.0070.00915.59
7.3.30.0110.00615.58
7.3.20.0130.00316.55
7.3.10.0070.00716.31
7.3.00.0090.00516.60
7.2.330.0090.00916.81
7.2.320.0100.00616.64
7.2.310.0140.00316.73
7.2.300.0110.00716.57
7.2.290.0030.01316.37
7.2.280.0090.00916.47
7.2.270.0090.00916.43
7.2.260.0090.00916.36
7.2.250.0100.00715.86
7.2.240.0070.00915.72
7.2.230.0090.00515.82
7.2.220.0070.00715.80
7.2.210.0090.01015.64
7.2.200.0050.01015.87
7.2.190.0080.01015.80
7.2.180.0070.00915.69
7.2.170.0100.00515.64
7.2.160.0160.00616.46
7.2.150.0120.01216.54
7.2.140.0170.00016.64
7.2.130.0060.01216.39
7.2.120.0090.00916.48
7.2.110.0120.00616.44
7.2.100.0060.01216.53
7.2.90.0150.00416.57
7.2.80.0070.01116.33
7.2.70.0070.01116.55
7.2.60.0090.00616.80
7.2.50.0060.01216.44
7.2.40.0030.01416.60
7.2.30.0090.00916.48
7.2.20.0140.00316.43
7.2.10.0070.01016.63
7.2.00.0120.00616.76
7.1.330.0060.00915.48
7.1.320.0070.00715.67
7.1.310.0060.01015.63
7.1.300.0060.01215.71
7.1.290.0090.00715.46
7.1.280.0200.00715.56
7.1.270.0060.01015.65
7.1.260.0070.00615.63
7.1.250.0100.00715.43
7.1.240.0120.00915.28
7.1.230.0090.01415.30
7.1.220.0070.01115.47
7.1.210.0100.00715.28
7.1.200.0080.00815.56
7.1.190.0140.00315.30
7.1.180.0060.01315.45
7.1.170.0140.00515.36
7.1.160.0100.00615.32
7.1.150.0100.00715.30
7.1.140.0040.01215.49
7.1.130.0070.01015.59
7.1.120.0030.01415.29
7.1.110.0100.01015.48
7.1.100.0090.00615.27
7.1.90.0020.01415.21
7.1.80.0080.00815.39
7.1.70.0060.00816.20
7.1.60.0080.00616.46
7.1.50.0120.00616.11
7.1.40.0040.01215.38
7.1.30.0090.00915.35
7.1.20.0040.01215.49
7.1.10.0080.00815.38
7.1.00.0110.03918.81
7.0.330.0120.00414.78
7.0.320.0120.00414.92
7.0.310.0100.01114.94
7.0.300.0140.00714.93
7.0.290.0100.00814.91
7.0.280.0030.01314.88
7.0.270.0030.01214.89
7.0.260.0120.00615.00
7.0.250.0080.00815.10
7.0.240.0070.00714.99
7.0.230.0080.00814.99
7.0.220.0060.01015.02
7.0.210.0030.01215.05
7.0.200.0050.01016.05
7.0.190.0090.00615.04
7.0.180.0080.00815.05
7.0.170.0070.01115.11
7.0.160.0060.01014.90
7.0.150.0150.00615.10
7.0.140.0140.03818.55
7.0.130.0080.00814.85
7.0.120.0070.01415.16
7.0.110.0100.00614.89
7.0.100.0110.00614.89
7.0.90.0060.01115.05
7.0.80.0120.00415.10
7.0.70.0100.00514.93
7.0.60.0080.04517.45
7.0.50.0110.04016.41
7.0.40.0100.05017.53
7.0.30.0320.02917.61
7.0.20.0080.03217.55
7.0.10.0070.03417.51
7.0.00.0050.02817.54
5.6.400.0060.01215.76
5.6.390.0030.01715.77
5.6.380.0030.01615.84
5.6.370.0080.01115.68
5.6.360.0050.01415.87
5.6.350.0090.00915.86
5.6.340.0070.01115.72
5.6.330.0150.00415.86
5.6.320.0150.00315.61
5.6.310.0060.01215.88
5.6.300.0100.01015.75
5.6.290.0110.01116.00
5.6.280.0090.03918.45
5.6.270.0100.01015.54
5.6.260.0120.01215.79
5.6.250.0090.01515.61
5.6.240.0170.00315.59
5.6.230.0090.00915.72
5.6.220.0100.00915.98
5.6.210.0070.05018.15
5.6.200.0120.04316.90
5.6.190.0070.04918.27
5.6.180.0200.03018.15
5.6.170.0140.05118.12
5.6.160.0080.04318.16
5.6.150.0080.04816.97
5.6.140.0060.02617.07
5.6.130.0100.04316.91
5.6.120.0110.04518.39
5.6.110.0100.04418.46
5.6.100.0080.04318.23
5.6.90.0130.04118.37
5.6.80.0080.03017.96
5.6.70.1980.02318.09
5.6.60.0070.01115.82
5.6.50.0130.00515.61
5.6.40.0100.00615.80
5.6.30.0060.01315.63
5.6.20.0170.00715.70
5.6.10.0030.01315.73
5.6.00.0100.00715.71
5.5.380.0030.01615.49
5.5.370.0060.01215.61
5.5.360.0110.00715.70
5.5.350.0150.04218.03
5.5.340.0040.03016.83
5.5.330.0050.03418.09
5.5.320.0110.02317.96
5.5.310.0160.03317.98
5.5.300.0030.03016.85
5.5.290.0080.02616.85
5.5.280.0030.04618.22
5.5.270.0120.04418.33
5.5.260.0110.04718.43
5.5.250.0080.04418.18
5.5.240.0100.02217.94
5.5.230.0040.01515.54
5.5.220.0060.01215.71
5.5.210.0070.01015.74
5.5.200.0030.02015.76
5.5.190.0060.01215.45
5.5.180.0150.00915.70
5.5.170.0060.01215.60
5.5.160.0120.00615.70
5.5.150.0040.01315.73
5.5.140.0030.01515.54
5.5.130.0040.01415.84
5.5.120.0120.00615.44
5.5.110.0180.00415.68
5.5.100.0080.01115.71
5.5.90.0080.01215.80
5.5.80.0090.01715.54
5.5.70.0100.01015.59
5.5.60.0100.01315.72
5.5.50.0110.01115.64
5.5.40.0120.01215.69
5.5.30.0150.00415.66
5.5.20.0060.01315.65
5.5.10.0070.01715.81
5.5.00.0000.01815.55
5.4.450.0200.02715.97
5.4.440.0250.02515.94
5.4.430.0150.02916.05
5.4.420.0130.02616.15
5.4.410.0130.02215.92
5.4.400.0180.02615.92
5.4.390.0080.02715.71
5.4.380.0220.02815.77
5.4.370.0250.02515.50
5.4.360.0290.02415.68
5.4.350.0200.03315.56
5.4.340.0200.03915.70
5.4.330.0040.00812.60
5.4.320.0060.02312.50
5.4.310.0080.02112.46
5.4.300.0060.02312.54
5.4.290.0090.02012.50
5.4.280.0050.02312.53
5.4.270.0070.02212.46
5.4.260.0090.02112.45
5.4.250.0060.02412.33
5.4.240.0060.02312.41
5.4.230.0040.02512.32
5.4.220.0080.02712.50
5.4.210.0090.01912.53
5.4.200.0080.02112.38
5.4.190.0060.02312.51
5.4.180.0030.03012.48
5.4.170.0080.02512.52
5.4.160.0080.02412.45
5.4.150.0040.02312.52
5.4.140.0070.02312.35
5.4.130.0100.02012.30
5.4.120.0060.02112.28
5.4.110.0080.02012.38
5.4.100.0080.02012.32
5.4.90.0100.02012.30
5.4.80.0030.02612.32
5.4.70.0090.02312.30
5.4.60.0060.02212.34
5.4.50.0090.01912.27
5.4.40.0060.02112.32
5.4.30.0070.02112.30
5.4.20.0070.02112.35
5.4.10.0080.02112.28
5.4.00.0080.02511.96
5.3.290.0040.02713.06
5.3.280.0070.02212.94
5.3.270.0070.02612.91
5.3.260.0060.02412.92
5.3.250.0040.02512.98
5.3.240.0050.02412.91
5.3.230.0060.02613.03
5.3.220.0060.02312.84
5.3.210.0070.02312.85
5.3.200.0020.02512.85
5.3.190.0080.02412.85
5.3.180.0060.02212.98
5.3.170.0090.02112.94
5.3.160.0050.02512.93
5.3.150.0060.02413.02
5.3.140.0070.02312.98
5.3.130.0040.02512.86
5.3.120.0020.02712.90
5.3.110.0040.02512.96
5.3.100.0060.02312.70
5.3.90.0020.02712.69
5.3.80.0040.02412.57
5.3.70.0090.01912.61
5.3.60.0070.02212.73
5.3.50.0050.02212.60
5.3.40.0040.02412.68
5.3.30.0060.02212.54
5.3.20.0040.02412.39
5.3.10.0090.02212.29
5.3.00.0050.02312.36
5.2.170.0060.02310.80
5.2.160.0080.01910.68
5.2.150.0040.02010.66
5.2.140.0080.01810.65
5.2.130.0070.02410.60
5.2.120.0050.02010.60
5.2.110.0060.01910.60
5.2.100.0050.01810.63
5.2.90.0060.01710.59
5.2.80.0040.02010.61
5.2.70.0040.01910.61
5.2.60.0050.02210.48
5.2.50.0080.01610.49
5.2.40.0050.01810.57
5.2.30.0060.02110.61
5.2.20.0040.02110.51
5.2.10.0030.02310.43
5.2.00.0070.01710.24
5.1.60.0060.0159.59
5.1.50.0070.0199.56
5.1.40.0040.0189.59
5.1.30.0070.0179.80
5.1.20.0020.0189.78
5.1.10.0060.0189.62
5.1.00.0020.0219.56
5.0.50.0040.0158.41
5.0.40.0050.0168.38
5.0.30.0030.0198.24
5.0.20.0070.0168.22
5.0.10.0060.0128.22
5.0.00.0060.0168.22
4.4.90.0050.0127.46
4.4.80.0040.0097.45
4.4.70.0040.0107.45
4.4.60.0050.0107.45
4.4.50.0050.0077.46
4.4.40.0020.0167.42
4.4.30.0040.0087.45
4.4.20.0040.0097.49
4.4.10.0030.0097.50
4.4.00.0030.0157.45
4.3.110.0030.0137.40
4.3.100.0030.0137.40
4.3.90.0050.0087.39
4.3.80.0010.0147.37
4.3.70.0020.0127.38
4.3.60.0030.0087.38
4.3.50.0030.0107.38
4.3.40.0020.0137.34
4.3.30.0020.0106.74
4.3.20.0030.0096.73
4.3.10.0020.0106.71
4.3.00.0090.00814.19

preferences:
41.4 ms | 401 KiB | 5 Q