3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); var_dump(intdiv(3, 2)); var_dump(intdiv(-3, 2)); var_dump(intdiv(3, -2)); var_dump(intdiv(-3, -2)); var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX)); var_dump(intdiv(~PHP_INT_MAX, ~PHP_INT_MAX)); try { var_dump(intdiv(~PHP_INT_MAX, -1)); } catch (Throwable $e) { echo "Exception: " . $e->getMessage() . "\n"; } try { var_dump(intdiv(1, 0)); } catch (Throwable $e) { echo "Exception: " . $e->getMessage() . "\n"; } $result = ob_get_contents(); ob_end_clean(); $expectedOutput = <<<EOT int(1) int(-1) int(-1) int(1) int(1) int(1) Exception: Division of PHP_INT_MIN by -1 is not an integer Exception: Division by zero EOT; if ($expectedOutput !== $result) { throw new \Exception('fail'); }

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.0110.00416.75
8.3.50.0080.01021.85
8.3.40.0040.01118.76
8.3.30.0140.00018.58
8.3.20.0070.00020.15
8.3.10.0000.00823.64
8.3.00.0000.00817.66
8.2.180.0060.00918.38
8.2.170.0110.00422.96
8.2.160.0100.00320.50
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0000.00726.16
8.2.120.0060.00317.62
8.2.110.0000.01122.25
8.2.100.0080.00417.93
8.2.90.0030.00619.27
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0050.00717.93
8.2.50.0000.00818.07
8.2.40.0030.00521.21
8.2.30.0080.00020.52
8.2.20.0050.00317.82
8.2.10.0070.00018.19
8.2.00.0040.00418.05
8.1.280.0060.00925.92
8.1.270.0060.00923.72
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0050.00522.52
8.1.230.0110.00017.43
8.1.220.0000.00917.76
8.1.210.0030.00618.77
8.1.200.0030.00717.48
8.1.190.0080.00017.22
8.1.180.0030.00618.10
8.1.170.0000.00820.23
8.1.160.0020.00522.03
8.1.150.0000.00818.89
8.1.140.0000.00819.60
8.1.130.0000.00717.68
8.1.120.0000.00717.51
8.1.110.0000.00717.46
8.1.100.0000.00717.36
8.1.90.0040.00417.48
8.1.80.0000.00717.35
8.1.70.0040.00417.53
8.1.60.0050.00317.60
8.1.50.0000.00817.45
8.1.40.0080.00017.50
8.1.30.0000.00817.65
8.1.20.0040.00417.59
8.1.10.0040.00417.43
8.1.00.0040.00417.41
8.0.300.0000.00818.77
8.0.290.0020.00516.75
8.0.280.0040.00418.38
8.0.270.0000.00917.24
8.0.260.0000.00717.28
8.0.250.0050.00317.02
8.0.240.0000.00717.06
8.0.230.0050.00317.01
8.0.220.0030.00316.99
8.0.210.0040.00417.04
8.0.200.0000.01017.05
8.0.190.0040.00416.91
8.0.180.0070.00316.89
8.0.170.0040.00417.04
8.0.160.0000.00716.94
8.0.150.0030.00616.83
8.0.140.0050.00316.91
8.0.130.0000.00613.40
8.0.120.0040.00416.97
8.0.110.0070.00016.96
8.0.100.0000.00716.83
8.0.90.0030.00316.98
8.0.80.0110.00616.95
8.0.70.0000.00716.85
8.0.60.0040.00416.89
8.0.50.0000.00716.86
8.0.30.0110.00817.02
8.0.20.0080.01217.40
8.0.10.0040.00416.90
8.0.00.0040.01416.74
7.4.330.0000.00515.08
7.4.320.0040.00416.62
7.4.300.0000.00616.52
7.4.290.0000.00716.45
7.4.280.0040.00416.52
7.4.270.0000.00716.62
7.4.260.0030.00316.48
7.4.250.0020.00516.44
7.4.240.0040.00316.62
7.4.230.0000.00716.51
7.4.220.0100.01016.70
7.4.210.0100.00616.64
7.4.200.0030.00316.69
7.4.160.0110.00616.60
7.4.150.0040.01917.40
7.4.140.0100.00817.86
7.4.130.0070.01016.47
7.4.120.0100.01016.61
7.4.110.0100.01316.41
7.4.100.0120.00916.47
7.4.90.0140.00416.68
7.4.80.0030.01419.39
7.4.70.0110.00916.57
7.4.60.0040.01116.66
7.4.50.0030.00616.55
7.4.40.0080.00816.71
7.4.30.0090.01316.45
7.4.10.0060.00916.36
7.4.00.0070.01115.59
7.3.330.0030.00213.29
7.3.320.0060.00013.23
7.3.310.0030.00416.48
7.3.300.0030.00616.35
7.3.290.0080.00716.38
7.3.280.0070.01216.35
7.3.270.0150.00317.40
7.3.260.0060.01616.46
7.3.240.0100.00916.51
7.3.230.0100.00716.58
7.3.210.0130.00316.52
7.3.200.0110.01116.36
7.3.190.0080.00816.44
7.3.180.0130.00316.34
7.3.170.0040.01816.45
7.3.160.0060.01316.45
7.3.130.0070.01116.36
7.3.120.0060.01316.54
7.3.110.0000.01316.43
7.3.100.0030.01416.36
7.3.90.0070.00716.58
7.3.80.0030.00916.65
7.3.70.0040.01116.31
7.3.60.0030.01016.41
7.3.50.0100.00616.52
7.3.40.0070.00716.39
7.3.30.0060.00916.26
7.3.20.0040.00818.36
7.3.10.0030.01318.13
7.3.00.0040.01118.05
7.2.330.0100.01316.80
7.2.320.0030.01916.54
7.2.310.0130.00916.89
7.2.300.0080.00816.71
7.2.290.0130.01016.77
7.2.260.0070.01116.81
7.2.250.0150.00716.43
7.2.240.0030.00616.44
7.2.230.0100.00616.73
7.2.220.0060.01116.52
7.2.210.0000.01316.74
7.2.200.0120.00316.61
7.2.190.0120.00616.66
7.2.180.0030.00616.71
7.2.170.0060.00916.65
7.2.160.0070.00716.72
7.2.150.0000.01018.52
7.2.140.0040.01418.50
7.2.130.0070.01118.43
7.2.120.0060.01218.45
7.2.110.0000.01218.50
7.2.100.0100.00718.42
7.2.90.0070.01018.45
7.2.80.0100.00318.46
7.2.70.0000.01318.46
7.2.60.0070.00917.73
7.2.50.0110.01118.37
7.2.40.0040.00818.47
7.2.30.0000.01318.57
7.2.20.0100.00618.33
7.2.10.0070.00318.34
7.2.00.0110.00418.37
7.1.330.0110.00417.19
7.1.320.0040.01217.37
7.1.310.0060.01017.20
7.1.300.0060.00617.32
7.1.290.0000.01217.23
7.1.280.0090.00617.40
7.1.270.0070.00717.21
7.1.260.0030.01217.30
7.1.250.0030.00617.25
7.1.240.0000.01417.26
7.1.230.0070.00717.27
7.1.220.0040.01117.27
7.1.210.0040.00817.30
7.1.200.0040.00916.46
7.1.190.0070.01117.26
7.1.180.0100.00617.28
7.1.170.0100.01017.39
7.1.160.0030.01017.25
7.1.150.0030.00917.16
7.1.140.0030.01217.27
7.1.130.0040.00817.35
7.1.120.0050.00517.21
7.1.110.0070.01117.43
7.1.100.0030.01017.71
7.1.90.0040.00817.32
7.1.80.0060.00617.27
7.1.70.0070.01217.26
7.1.60.0070.00918.42
7.1.50.0050.01417.20
7.1.40.0060.01117.26
7.1.30.0030.01217.28
7.1.20.0070.00717.27
7.1.10.0000.01017.20
7.1.00.0050.04519.90
7.0.330.0030.01116.92
7.0.320.0030.01316.94
7.0.310.0090.00616.85
7.0.300.0080.00416.99
7.0.290.0030.01016.96
7.0.280.0030.01316.79
7.0.270.0030.01016.95
7.0.260.0080.00816.92
7.0.250.0090.00917.00
7.0.240.0120.00617.01
7.0.230.0070.00717.04
7.0.220.0110.00417.13
7.0.210.0080.00316.93
7.0.200.0020.00916.84
7.0.190.0090.00316.91
7.0.180.0060.00916.84
7.0.170.0060.00816.97
7.0.160.0060.00316.88
7.0.150.0080.00816.99
7.0.140.0090.00916.89
7.0.130.0130.00317.01
7.0.120.0060.00617.04
7.0.110.0080.00417.01
7.0.100.0090.00917.00
7.0.90.0130.00316.88
7.0.80.0040.01117.12
7.0.70.0090.00916.92
7.0.60.0080.02018.36
7.0.50.0070.04217.39
7.0.40.0020.03017.54
7.0.30.0150.02817.57
7.0.20.0190.04117.56
7.0.10.0210.03817.59
7.0.00.0050.04717.50
5.6.400.0030.01015.79
5.6.390.0060.00615.75
5.6.380.0030.01215.47
5.6.370.0070.00415.79
5.6.360.0070.00415.63
5.6.350.0080.00315.67
5.6.340.0060.00615.68
5.6.330.0000.01015.77
5.6.320.0070.01115.48
5.6.310.0070.00715.52
5.6.300.0040.01515.76
5.6.290.0060.00915.75
5.6.280.0020.02218.42
5.6.270.0030.01315.77
5.6.260.0040.01515.58
5.6.250.0100.01015.84
5.6.240.0070.01015.88
5.6.230.0070.00315.55
5.6.220.0040.01415.82
5.6.210.0120.04318.06
5.6.200.0050.03416.87
5.6.190.0070.02818.05
5.6.180.2070.02718.02
5.6.170.0220.04118.19
5.6.160.0090.03718.06
5.6.150.0070.04716.86
5.6.140.0030.02816.90
5.6.130.0070.04616.85
5.6.120.0110.02818.37
5.6.110.0080.03818.26
5.6.100.0050.04018.31
5.6.90.0050.02818.28
5.6.80.0090.04417.90
5.6.70.0080.02918.02
5.6.60.0030.00715.43
5.6.50.0070.00715.70
5.6.40.0030.01315.48
5.6.30.0060.01015.82
5.6.20.0000.01515.78
5.6.10.0000.01415.53
5.6.00.0030.01115.48
5.5.380.0030.01415.59
5.5.370.0070.00715.47
5.5.360.0030.00915.34
5.5.350.0100.04717.95
5.5.340.0050.02316.78
5.5.330.0050.03317.87
5.5.320.0150.03017.89
5.5.310.0150.04517.86
5.5.300.0070.03016.71
5.5.290.0040.02716.68
5.5.280.0100.03718.31
5.5.270.0080.04318.14
5.5.260.0070.04818.23
5.5.250.0070.04918.04
5.5.240.0090.02017.75
5.5.230.0070.00815.46
5.5.220.0090.00615.41
5.5.210.0070.00715.64
5.5.200.0130.00315.46
5.5.190.0070.00315.55
5.5.180.0040.00815.68
5.5.170.0090.00315.49
5.5.160.0070.01115.52
5.5.150.0030.00615.63
5.5.140.0060.00315.57
5.5.130.0060.00615.52
5.5.120.0100.00315.37
5.5.110.0030.01015.63
5.5.100.0040.01115.48
5.5.90.0040.00715.21
5.5.80.0070.00715.63
5.5.70.0080.00815.39
5.5.60.0030.01015.55
5.5.50.0030.01015.27
5.5.40.0040.01115.50
5.5.30.0060.00615.59
5.5.20.0000.01015.53
5.5.10.0080.00815.54
5.5.00.0000.01315.20
5.4.450.0140.04016.71
5.4.440.0160.03116.62
5.4.430.0090.02516.69
5.4.420.0130.04216.78
5.4.410.0150.03516.71
5.4.400.0130.02416.57
5.4.390.0150.03816.46
5.4.380.0130.04016.45
5.4.370.0180.02316.54
5.4.360.0130.03816.57
5.4.350.0140.02216.53
5.4.340.0160.01716.53
5.4.330.0080.00313.98
5.4.320.0130.03016.62
5.4.310.0120.02516.54
5.4.300.0110.02316.53
5.4.290.0170.03716.54
5.4.280.0150.03416.46
5.4.270.0130.04016.62
5.4.260.0100.03216.58
5.4.250.0110.02716.55
5.4.240.0100.02016.52
5.4.230.0140.03216.45
5.4.220.0070.02516.45
5.4.210.0080.02316.55
5.4.200.0130.02016.53
5.4.190.0110.01816.51
5.4.180.0080.02516.55
5.4.170.0030.02616.52
5.4.160.0070.02216.42
5.4.150.0130.02216.52
5.4.140.0080.02315.14
5.4.130.0150.01715.19
5.4.120.0080.01915.13
5.4.110.0080.02015.21
5.4.100.0080.01815.16
5.4.90.0070.02015.19
5.4.80.0110.00013.98
5.4.70.0000.00913.98
5.4.60.0060.00613.98
5.4.50.0000.00613.98
5.4.40.0060.00313.98
5.4.30.0030.00713.98
5.4.20.0090.00013.98
5.4.10.0040.00413.98
5.4.00.0050.00513.98

preferences:
63.69 ms | 401 KiB | 5 Q