3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Compare non numeric string to string 0: ('str' == '0') = " . ('str' == '0' ? 'true' : 'false') . "\n"; echo "Compare non numeric string to integer 0: ('str' == 0) = " . ('str' == 0 ? 'true' : 'false') . "\n"; echo "What are numeric strings: ('1string' == '1') = " . ('1string' == '1' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 1): ('1e1' == '10') = " . ('1e1' == '10' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 2): ('1E1' == '10') = " . ('1E1' == '10' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 3): ('1e-1' == '0.1') = " . ('1e-1' == '0.1' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 4): ('1E-1' == '0.1') = " . ('1E-1' == '0.1' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 5): ('+1' == '1') = " . ('+1' == '1' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (same semantic 6): ('+0' == '-0') = " . ('+0' == '-0' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (precision 1): ('0.99999999999999994' == '1') = " . ('0.99999999999999994' == '1' ? 'true' : 'false') . "\n"; echo "Compare two numeric strings (precision 2): ('0.99999999999999995' == '1') = " . ('0.99999999999999995' == '1' ? 'true' : 'false') . "\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.0150.00018.39
8.3.50.0100.00721.93
8.3.40.0070.01118.79
8.3.30.0070.01020.23
8.3.20.0040.00418.70
8.3.10.0080.00020.80
8.3.00.0080.00019.67
8.2.180.0140.00716.88
8.2.170.0070.00722.96
8.2.160.0130.00720.58
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0090.00026.16
8.2.120.0000.00720.96
8.2.110.0090.00020.30
8.2.100.0040.00817.91
8.2.90.0040.00419.09
8.2.80.0000.00719.25
8.2.70.0090.00017.25
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0040.00419.82
8.2.30.0000.00719.46
8.2.20.0040.00417.55
8.2.10.0050.00217.76
8.2.00.0040.00417.76
8.1.280.0110.00425.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.34
8.1.230.0070.00421.03
8.1.220.0040.00418.77
8.1.210.0040.00419.04
8.1.200.0000.00817.22
8.1.190.0000.00817.40
8.1.180.0060.00318.10
8.1.170.0040.00418.46
8.1.160.0000.00818.77
8.1.150.0040.00418.61
8.1.140.0030.00517.40
8.1.130.0000.00717.79
8.1.120.0070.00017.43
8.1.110.0040.00417.45
8.1.100.0040.00417.25
8.1.90.0080.00017.34
8.1.80.0070.00017.38
8.1.70.0000.00717.31
8.1.60.0040.00717.50
8.1.50.0000.00717.46
8.1.40.0040.00417.51
8.1.30.0000.00817.54
8.1.20.0000.00817.66
8.1.10.0030.00617.38
8.1.00.0050.00317.38
8.0.300.0040.00419.89
8.0.290.0000.00717.05
8.0.280.0000.00718.32
8.0.270.0030.00317.23
8.0.260.0030.00316.84
8.0.250.0070.00017.00
8.0.240.0000.00817.00
8.0.230.0040.00416.95
8.0.220.0020.00516.98
8.0.210.0070.00016.80
8.0.200.0030.00317.04
8.0.190.0050.00316.98
8.0.180.0000.00716.93
8.0.170.0000.00816.79
8.0.160.0050.00317.02
8.0.150.0000.00816.80
8.0.140.0020.00516.78
8.0.130.0070.00013.36
8.0.120.0040.00416.78
8.0.110.0040.00416.97
8.0.100.0040.00416.85
8.0.90.0040.00416.88
8.0.80.0090.00616.89
8.0.70.0070.00016.81
8.0.60.0040.00416.75
8.0.50.0040.00416.91
8.0.30.0100.01017.14
8.0.20.0070.01217.40
8.0.10.0040.00417.07
8.0.00.0090.01216.58
7.4.330.0000.00516.79
7.4.320.0030.00316.38
7.4.300.0000.00916.50
7.4.290.0030.00316.29
7.4.280.0000.00716.35
7.4.270.0070.00016.40
7.4.260.0000.00513.19
7.4.250.0040.00416.37
7.4.240.0050.00316.49
7.4.230.0000.00716.58
7.4.220.0110.00716.46
7.4.210.0050.01216.40
7.4.200.0000.00716.32
7.4.190.0000.00716.27
7.4.160.0110.00616.59
7.4.150.0170.00017.40
7.4.140.0110.01017.86
7.4.130.0140.00616.43
7.4.120.0090.00916.52
7.4.110.0090.00816.50
7.4.100.0120.00916.45
7.4.90.0100.01316.36
7.4.80.0130.01319.39
7.4.70.0100.01016.46
7.4.60.0060.01016.43
7.4.50.0090.00016.54
7.4.40.0000.01322.77
7.4.30.0160.00416.53
7.4.00.0060.00614.68
7.3.330.0030.00512.98
7.3.320.0000.00613.09
7.3.310.0000.00716.37
7.3.300.0030.00316.27
7.3.290.0090.00616.17
7.3.280.0050.01116.27
7.3.270.0100.00717.40
7.3.260.0140.00518.24
7.3.250.0130.00716.37
7.3.240.0100.00716.24
7.3.230.0150.00316.39
7.3.210.0110.00616.17
7.3.200.0030.01419.39
7.3.190.0080.00916.24
7.3.180.0080.01116.20
7.3.170.0090.00616.52
7.3.160.0090.00616.38
7.3.120.0060.00614.87
7.3.10.0080.00716.65
7.3.00.0030.01016.70
7.2.330.0060.01316.45
7.2.320.0070.01016.31
7.2.310.0060.01316.79
7.2.300.0100.01316.47
7.2.290.0080.00816.65
7.2.130.0000.01716.63
7.2.120.0030.01316.70
7.2.110.0070.00716.78
7.2.100.0110.00416.89
7.2.90.0080.00316.82
7.2.80.0060.00316.95
7.2.70.0040.00716.95
7.2.60.0040.00616.96
7.2.50.0000.00916.87
7.2.40.0110.00416.65
7.2.30.0110.00416.87
7.2.20.0060.00316.88
7.2.10.0040.01117.05
7.2.00.0070.00518.22
7.1.250.0060.01015.75
7.1.200.0060.00315.45
7.1.100.0090.00317.92
7.1.70.0060.00317.09
7.1.60.0030.00717.14
7.1.50.0140.00316.82
7.1.00.0030.03322.41
7.0.200.0030.01316.39
7.0.140.0100.06721.96
7.0.60.0030.09319.97
7.0.50.0000.04717.82
7.0.40.0030.04319.90
7.0.30.0170.04720.09
7.0.20.0270.07720.13
7.0.10.0200.04320.34
7.0.00.0030.05320.02
5.6.280.0000.07721.09
5.6.210.0030.08020.52
5.6.200.0070.07318.21
5.6.190.0000.06720.60
5.6.180.0300.08020.64
5.6.170.0270.07720.44
5.6.160.0070.08320.38
5.6.150.0030.07018.07
5.6.140.0070.04718.21
5.6.130.0030.04018.18
5.6.120.0200.07020.97
5.6.110.0070.08321.14
5.6.100.0030.08720.98
5.6.90.0200.06721.13
5.6.80.0030.07320.44
5.6.70.0300.08020.40
5.5.350.0330.07320.31
5.5.340.0100.08018.00
5.5.330.0130.07720.42
5.5.320.0230.07020.21
5.5.310.0300.04320.13
5.5.300.0030.08018.00
5.5.290.0030.04717.98
5.5.280.0070.08320.77
5.5.270.0030.04320.80
5.5.260.0000.04720.76
5.5.250.0030.08020.58
5.5.240.0070.03720.27
5.4.450.1770.04719.57
5.4.440.1800.04719.57
5.4.430.1530.04319.25
5.4.420.1930.03719.20
5.4.410.1700.04019.43
5.4.400.2000.04019.24
5.4.390.1670.04019.05
5.4.380.1770.03319.25
5.4.370.1830.04018.93
5.4.360.1530.04318.77
5.4.350.1570.04019.26
5.4.340.1830.03019.09
5.4.320.1800.03319.09
5.4.310.1900.05019.09
5.4.300.1700.04018.77
5.4.290.0400.04319.09
5.4.280.0070.04719.24
5.4.270.0170.03719.18
5.4.260.1500.03718.79
5.4.250.1470.04018.92
5.4.240.1770.03319.08
5.4.230.1670.03719.13
5.4.220.1600.03719.21
5.4.210.1470.03719.13
5.4.200.1700.03719.10
5.4.190.1670.04019.12
5.4.180.1700.03718.75
5.4.170.1670.04018.92
5.4.160.2370.03318.86
5.4.150.1270.04019.20
5.4.140.0030.03716.43
5.4.130.0000.03716.45
5.4.120.1100.03316.34
5.4.110.1470.03316.39
5.4.100.1470.02716.38
5.4.90.1400.03716.38
5.4.80.1430.03716.39
5.4.70.1530.02716.42
5.4.60.1470.04316.29
5.4.50.1670.03716.36
5.4.40.1830.03716.49
5.4.30.2000.03316.32
5.4.20.1700.05016.38
5.4.10.1670.03016.04
5.4.00.1630.03015.69
5.3.290.1870.04714.66
5.3.280.1830.04714.55
5.3.270.1900.06014.47
5.3.260.1770.04714.48
5.3.250.1830.04314.46
5.3.240.1770.04014.46
5.3.230.1800.04714.63
5.3.220.1870.04014.43
5.3.210.1630.03314.63
5.3.200.1730.04014.42
5.3.190.1730.03014.41
5.3.180.1870.04014.44
5.3.170.1770.04014.45
5.3.160.1930.04014.53
5.3.150.1770.03714.48
5.3.140.1900.04314.47
5.3.130.2070.03714.42
5.3.120.1730.04014.40
5.3.110.1900.03314.51
5.3.100.1900.04714.10
5.3.90.1570.04013.88
5.3.80.1870.04313.87
5.3.70.1830.03013.83
5.3.60.0070.07013.95
5.3.50.0000.04014.00
5.3.40.0030.07313.89
5.3.30.1530.05713.72
5.3.20.1770.03713.69
5.3.10.1930.03713.68
5.3.00.1830.03713.48
5.2.170.1570.03311.21
5.2.160.1630.03311.01
5.2.150.1370.03011.05
5.2.140.1630.03711.02
5.2.130.1630.02711.18
5.2.120.1670.03710.98
5.2.110.1630.03311.02
5.2.100.1300.02011.03
5.2.90.1970.02711.07
5.2.80.1330.03311.12
5.2.70.1330.03310.96
5.2.60.1630.03311.08
5.2.50.1500.02010.89
5.2.40.1200.02311.18
5.2.30.1170.03010.84
5.2.20.1170.03310.80
5.2.10.1330.03310.87
5.2.00.1170.03310.73
5.1.60.1170.02010.09
5.1.50.1200.0279.98
5.1.40.1370.02710.15
5.1.30.1130.02710.25
5.1.20.1070.03010.41
5.1.10.1170.02710.06
5.1.00.1200.02010.13
5.0.50.0670.0238.50
5.0.40.0670.0178.59
5.0.30.0530.0338.14
5.0.20.0570.0208.29
5.0.10.0570.0208.11
5.0.00.0570.0308.12
4.4.90.0570.0137.54
4.4.80.0630.0137.54
4.4.70.0570.0137.54
4.4.60.0700.0237.55
4.4.50.0700.0237.55
4.4.40.0600.0307.58
4.4.30.0570.0207.58
4.4.20.0600.0177.59
4.4.10.0570.0177.59
4.4.00.0630.0207.59
4.3.110.0570.0177.59
4.3.100.0630.0107.59
4.3.90.0730.0137.60
4.3.80.0630.0337.63
4.3.70.0730.0277.63
4.3.60.0570.0137.64
4.3.50.0700.0177.66
4.3.40.0700.0307.67
4.3.30.0270.0177.69
4.3.20.0370.0277.69
4.3.10.0300.0137.70
4.3.00.0300.0137.70

preferences:
104.22 ms | 401 KiB | 5 Q