3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_case($a, $b, $c) { // Without Parenthesis if ($a || $b && $c) { $test1 = TRUE; } else { $test1 = FALSE; } // With Parenthesis if (($a || $b) && $c) { $test2 = TRUE; } else { $test2 = FALSE; } // Compare result if ($test1 !== $test2) { printf( 'Condition (%s || %s && %s) does NOT match ((%s || %s) && %s) --- Should have been "%s" but was actually "%s"'.PHP_EOL, strtoupper(var_export($a, TRUE)), strtoupper(var_export($b, TRUE)), strtoupper(var_export($c, TRUE)), strtoupper(var_export($a, TRUE)), strtoupper(var_export($b, TRUE)), strtoupper(var_export($c, TRUE)), strtoupper(var_export($test2, TRUE)), strtoupper(var_export($test1, TRUE)) ); } else { printf( 'Condition (%s || %s && %s) works as intended'.PHP_EOL, strtoupper(var_export($a, TRUE)), strtoupper(var_export($b, TRUE)), strtoupper(var_export($c, TRUE)) ); } } // Test all possible variations test_case(TRUE, TRUE, TRUE); test_case(TRUE, TRUE, FALSE); test_case(TRUE, FALSE, TRUE); test_case(TRUE, FALSE, FALSE); test_case(FALSE, TRUE, TRUE); test_case(FALSE, TRUE, FALSE); test_case(FALSE, FALSE, TRUE); test_case(FALSE, FALSE, FALSE);

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.5.10.0100.00816.75
8.5.00.0050.00420.18
8.4.150.0030.00014.05
8.4.140.0150.00617.66
8.4.130.0130.00717.70
8.4.120.0110.00922.13
8.4.110.0140.00722.30
8.4.100.0100.01117.58
8.4.90.0100.00722.05
8.4.80.0050.00817.96
8.4.70.0060.00417.81
8.4.60.0150.00518.68
8.4.50.0090.01120.52
8.4.40.0090.01319.32
8.4.30.0100.01019.16
8.4.20.0090.00618.84
8.4.10.0090.00019.62
8.3.280.0100.01018.33
8.3.270.0120.00716.75
8.3.260.0100.00916.50
8.3.250.0100.00920.63
8.3.240.0150.00416.74
8.3.230.0100.00916.57
8.3.220.0170.00217.28
8.3.210.0110.00816.49
8.3.200.0050.00416.64
8.3.190.0040.00418.96
8.3.180.0060.01218.54
8.3.170.0060.01217.01
8.3.160.0110.00419.98
8.3.150.0110.00816.54
8.3.140.0140.00417.14
8.3.130.0180.00717.58
8.3.120.0200.00817.73
8.3.110.0160.00818.59
8.3.100.0130.00616.37
8.3.90.0130.00321.68
8.3.80.0170.00217.31
8.3.70.0180.00617.43
8.3.60.0180.00717.24
8.3.50.0120.01116.23
8.3.40.0170.00918.10
8.3.30.0180.00517.99
8.3.20.0190.00218.67
8.3.10.0160.00620.48
8.3.00.0120.00319.85
8.2.290.0100.00920.19
8.2.280.0130.00718.15
8.2.270.0090.00916.89
8.2.260.0110.00716.82
8.2.250.0210.00816.37
8.2.240.0210.00317.64
8.2.230.0200.00519.46
8.2.220.0180.00920.25
8.2.210.0200.00321.47
8.2.200.0210.00316.48
8.2.190.0170.01217.31
8.2.180.0170.00916.58
8.2.170.0190.01320.21
8.2.160.0270.00519.96
8.2.150.0240.00220.84
8.2.140.0200.00720.99
8.2.130.0170.00921.63
8.2.120.0160.01019.18
8.2.110.0250.00119.00
8.2.100.0200.00817.66
8.2.90.0200.00517.56
8.2.80.0190.00818.16
8.2.70.0160.00917.56
8.2.60.0110.00317.49
8.2.50.0140.00017.58
8.2.40.0090.00618.89
8.2.30.0160.00118.37
8.2.20.0190.00217.79
8.2.10.0120.00718.40
8.2.00.0110.00817.79
8.1.330.0110.00722.04
8.1.320.0110.00816.45
8.1.310.0050.00318.38
8.1.300.0190.00717.71
8.1.290.0190.00323.51
8.1.280.0180.00921.05
8.1.270.0200.00619.79
8.1.260.0160.00521.79
8.1.250.0220.00322.67
8.1.240.0220.00620.66
8.1.230.0150.01020.58
8.1.220.0210.00517.88
8.1.210.0160.00417.99
8.1.200.0190.00417.14
8.1.190.0230.00017.12
8.1.180.0150.00717.49
8.1.170.0200.00217.71
8.1.160.0130.00817.97
8.1.150.0120.00818.06
8.1.140.0190.00318.72
8.1.130.0170.00619.55
8.1.120.0190.00217.33
8.1.110.0130.01017.18
8.1.100.0200.00317.25
8.1.90.0170.00517.33
8.1.80.0150.00717.36
8.1.70.0130.00517.29
8.1.60.0130.00917.51
8.1.50.0210.00517.47
8.1.40.0180.00717.46
8.1.30.0180.00517.46
8.1.20.0140.00917.61
8.1.10.0150.00817.27
8.1.00.0160.00717.31
8.0.300.0120.00118.21
8.0.290.0120.00016.67
8.0.280.0120.00017.47
8.0.270.0160.00716.90
8.0.260.0130.00918.25
8.0.250.0150.00716.83
8.0.240.0140.00816.83
8.0.230.0200.00316.80
8.0.220.0070.00916.68
8.0.210.0270.00416.67
8.0.200.0190.00816.82
8.0.190.0200.00416.77
8.0.180.0140.00516.73
8.0.170.0070.01316.71
8.0.160.0160.00616.73
8.0.150.0160.00416.78
8.0.140.0190.00416.62
8.0.130.0120.01114.99
8.0.120.0180.00416.76
8.0.110.0150.00816.76
8.0.100.0180.00516.62
8.0.90.0160.00616.52
8.0.80.0260.00316.65
8.0.70.0170.00516.65
8.0.60.0180.00316.70
8.0.50.0180.00516.61
8.0.30.0170.00516.89
8.0.20.0110.00717.01
8.0.10.0090.00316.85
8.0.00.0130.00716.84
7.4.330.0120.00515.90
7.4.320.0140.00516.43
7.4.300.0180.00516.47
7.4.290.0150.00616.38
7.4.280.0130.00816.51
7.4.270.0100.01016.42
7.4.260.0130.00816.43
7.4.250.0140.00816.40
7.4.240.0160.00516.38
7.4.230.0180.00716.35
7.4.220.0160.00416.35
7.4.210.0100.01116.41
7.4.200.0150.00516.36
7.4.190.0330.00016.31
7.4.180.0280.00516.31
7.4.160.0100.01016.45
7.4.150.0320.00016.25
7.4.140.0200.00517.33
7.4.130.0230.00516.29
7.4.120.0230.00416.36
7.4.110.0210.00516.38
7.4.100.0180.00716.38
7.4.90.0160.01016.28
7.4.80.0190.00617.82
7.4.70.0200.00816.48
7.4.60.0130.01516.30
7.4.50.0120.00816.36
7.4.40.0180.00316.31
7.4.30.0220.00616.18
7.4.20.0300.00416.18
7.4.10.0150.01116.33
7.4.00.0110.00815.35
7.3.330.0120.00614.74
7.3.320.0120.00614.66
7.3.310.0120.00716.18
7.3.300.0140.00616.19
7.3.290.0190.00216.19
7.3.280.0130.00716.23
7.3.270.0220.00416.18
7.3.260.0120.01016.44
7.3.250.0230.00916.18
7.3.240.0150.00816.40
7.3.230.0270.00816.29
7.3.220.0270.00816.18
7.3.210.0180.00716.35
7.3.200.0210.00316.20
7.3.190.0180.00816.26
7.3.180.0170.00916.29
7.3.170.0130.01616.29
7.3.160.0180.00716.41
7.3.150.0270.00716.18
7.3.140.0270.00716.18
7.3.130.0210.00616.27
7.3.120.0080.01115.24
7.3.110.0120.00815.39
7.3.100.0110.00615.40
7.3.90.0100.00815.30
7.3.80.0090.00815.32
7.3.70.0090.00815.30
7.3.60.0100.00515.30
7.3.50.0080.00815.27
7.3.40.0120.00515.29
7.3.30.0070.00915.21
7.3.20.0230.00716.58
7.3.10.0260.00616.50
7.3.00.0260.00916.41
7.2.340.0210.01216.18
7.2.330.0200.00716.32
7.2.320.0190.00716.46
7.2.310.0110.01416.47
7.2.300.0210.00516.26
7.2.290.0200.00816.31
7.2.280.0190.01416.21
7.2.270.0290.00016.21
7.2.260.0190.00216.39
7.2.250.0120.00915.59
7.2.240.0120.00915.53
7.2.230.0090.01015.52
7.2.220.0080.01115.43
7.2.210.0090.00915.43
7.2.200.0080.00915.51
7.2.190.0080.01015.41
7.2.180.0090.00915.42
7.2.170.0090.00815.35
7.2.160.0110.00815.61
7.2.150.0730.00616.55
7.2.140.0380.00816.56
7.2.130.0370.00816.55
7.2.120.0510.00416.65
7.2.110.0470.00516.43
7.2.100.0400.01116.58
7.2.90.0540.00616.52
7.2.80.0460.00716.62
7.2.70.0500.00816.71
7.2.60.0420.00516.67
7.2.50.0320.00916.68
7.2.40.0320.00516.60
7.2.30.0400.00716.49
7.2.20.0440.00916.50
7.2.10.0420.00416.49
7.2.00.0290.00516.58
7.1.330.0070.01116.32
7.1.320.0070.00816.23
7.1.310.0090.00816.24
7.1.300.0080.00816.23
7.1.290.0090.00916.23
7.1.280.0090.00616.25
7.1.270.0210.00615.62
7.1.260.0240.00715.63
7.1.250.0430.00615.62
7.1.240.0140.00917.04
7.1.230.0180.00517.22
7.1.220.0100.01317.13
7.1.210.0200.00317.11
7.1.200.0100.01217.00
7.1.190.0170.00617.10
7.1.180.0130.00317.17
7.1.170.0080.00517.15
7.1.160.0140.01016.99
7.1.150.0150.00817.13
7.1.140.0200.00716.99
7.1.130.0200.00317.10
7.1.120.0160.00617.21
7.1.110.0090.01417.10
7.1.100.0150.00717.28
7.1.90.0160.00517.27
7.1.80.0160.00717.12
7.1.70.0120.01116.99
7.1.60.0160.00417.20
7.1.50.0140.00717.22
7.1.40.0170.00517.22
7.1.30.0160.00717.18
7.1.20.0150.00617.13
7.1.10.0150.00917.03
7.1.00.0180.00717.03

preferences:
143.48 ms | 403 KiB | 5 Q