3v4l.org

run code in 300+ PHP versions simultaneously
<?php function intdiv_2($a, $b){ return floor($a / $b); } function isBouncy($num) { if ($num < 100) { return false; } $ni = true; $nd = true; $lastDigit = $num % 10; $num = intdiv_2($num, 10); while($num != 0) { $digit = $num % 10; if ($digit > $lastDigit) { $nd = false; } else if ($digit < $lastDigit) { $ni = false; } $lastDigit = $digit; $num = intdiv_2($num, 10); } return !$ni && !$nd; } echo isBouncy(0); echo isBouncy(10); echo isBouncy(345); echo isBouncy(321); echo isBouncy(384);

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.0120.00916.75
8.3.50.0110.00921.14
8.3.40.0110.00418.61
8.3.30.0070.00718.67
8.3.20.0040.00420.29
8.3.10.0040.00423.65
8.3.00.0090.00019.38
8.2.180.0090.00618.16
8.2.170.0130.00622.96
8.2.160.0140.00020.47
8.2.150.0060.00325.66
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0030.00717.63
8.2.110.0070.00419.46
8.2.100.0060.00618.01
8.2.90.0000.00919.32
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0040.00418.03
8.2.50.0000.00818.10
8.2.40.0050.00319.37
8.2.30.0050.00320.74
8.2.20.0000.00717.63
8.2.10.0070.00018.26
8.2.00.0040.00418.16
8.1.280.0030.01025.92
8.1.270.0070.01024.04
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00422.20
8.1.230.0070.00317.70
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0080.00017.35
8.1.180.0050.00218.10
8.1.170.0110.00018.78
8.1.160.0050.00522.09
8.1.150.0050.00218.89
8.1.140.0040.00419.71
8.1.130.0030.00317.79
8.1.120.0050.00217.55
8.1.110.0040.00417.57
8.1.100.0060.00317.62
8.1.90.0070.00017.51
8.1.80.0000.00817.57
8.1.70.0040.00417.45
8.1.60.0040.00417.55
8.1.50.0080.00017.59
8.1.40.0040.00417.58
8.1.30.0040.00417.65
8.1.20.0000.00717.76
8.1.10.0000.00817.50
8.1.00.0030.00517.42
8.0.300.0040.00719.88
8.0.290.0050.00316.88
8.0.280.0040.00418.52
8.0.270.0040.00717.30
8.0.260.0080.00017.27
8.0.250.0000.00816.95
8.0.240.0000.00716.95
8.0.230.0000.00717.08
8.0.220.0000.00716.85
8.0.210.0030.00316.98
8.0.200.0030.00317.01
8.0.190.0040.00417.06
8.0.180.0040.00417.00
8.0.170.0070.00016.96
8.0.160.0030.00317.07
8.0.150.0000.00716.89
8.0.140.0030.00516.99
8.0.130.0000.00513.46
8.0.120.0040.00416.96
8.0.110.0050.00217.03
8.0.100.0000.00817.00
8.0.90.0000.00816.93
8.0.80.0070.01016.98
8.0.70.0040.00416.84
8.0.60.0000.00717.04
8.0.50.0040.00417.09
8.0.30.0030.01317.23
8.0.20.0080.01217.43
8.0.10.0040.00417.14
8.0.00.0100.00716.78
7.4.330.0020.00215.08
7.4.320.0040.00416.59
7.4.300.0060.00016.65
7.4.290.0000.00716.48
7.4.280.0060.00316.47
7.4.270.0000.00716.63
7.4.260.0030.00316.58
7.4.250.0000.00816.65
7.4.240.0020.00516.62
7.4.230.0000.00816.48
7.4.220.0090.00916.70
7.4.210.0120.00816.77
7.4.200.0040.00416.78
7.4.160.0120.00816.84
7.4.150.0120.00617.40
7.4.140.0150.01017.86
7.4.130.0120.00916.50
7.4.120.0100.00816.56
7.4.110.0110.00816.36
7.4.100.0140.01016.64
7.4.90.0120.00616.58
7.4.80.0110.00919.39
7.4.70.0130.00316.56
7.4.60.0070.01716.58
7.4.50.0040.00416.51
7.4.40.0110.00616.52
7.4.30.0110.01216.76
7.4.00.0060.00814.99
7.3.330.0000.00513.40
7.3.320.0000.00613.51
7.3.310.0040.00416.53
7.3.300.0050.00216.45
7.3.290.0100.00916.44
7.3.280.0150.00616.41
7.3.270.0110.00717.40
7.3.260.0060.01016.21
7.3.250.0130.00416.59
7.3.240.0170.00116.54
7.3.230.0120.00616.39
7.3.210.0140.00416.30
7.3.200.0000.01716.33
7.3.190.0090.01216.72
7.3.180.0070.01016.73
7.3.170.0030.01616.63
7.3.160.0110.00516.43
7.3.120.0070.00714.60
7.3.110.0060.00914.88
7.3.100.0090.00614.88
7.3.90.0120.00014.70
7.3.80.0060.00614.54
7.3.70.0030.01014.92
7.3.60.0140.00014.66
7.3.50.0080.00014.67
7.3.40.0030.00814.65
7.3.30.0030.00614.89
7.3.20.0030.01216.50
7.3.10.0090.00016.72
7.3.00.0000.01216.63
7.2.330.0090.00916.47
7.2.320.0130.01016.84
7.2.310.0130.00716.77
7.2.300.0070.01016.80
7.2.290.0060.01416.42
7.2.250.0060.00614.82
7.2.240.0090.00615.10
7.2.230.0120.00314.90
7.2.220.0060.00615.14
7.2.210.0060.00615.05
7.2.200.0030.00715.13
7.2.190.0080.00315.08
7.2.180.0080.00415.06
7.2.170.0030.00715.09
7.1.330.0000.01215.65
7.1.320.0060.00315.96
7.1.310.0000.00815.68
7.1.300.0000.01415.91
7.1.290.0030.00915.92
7.1.280.0000.01515.88
7.1.270.0030.00915.83
7.1.260.0070.00715.70
7.1.70.0040.00416.89
7.1.60.0070.01719.43
7.1.50.0100.01317.05
7.1.00.0000.08022.57
7.0.200.0310.00714.88
7.0.60.0070.08719.92
7.0.50.0070.08317.89
7.0.40.0000.09720.05
7.0.30.0070.04020.09
7.0.20.0330.06320.15
7.0.10.0000.09020.24
7.0.00.0130.04720.19
5.6.280.0030.05321.13
5.6.210.0070.03720.52
5.6.200.0030.04018.29
5.6.190.0130.08020.57
5.6.180.0000.04320.53
5.6.170.0270.04320.45
5.6.160.0200.06720.50
5.6.150.0170.05018.18
5.6.140.0070.08318.23
5.6.130.0070.08018.14
5.6.120.0100.08720.89
5.6.110.0130.07321.04
5.6.100.0070.09020.94
5.6.90.0130.07721.07
5.6.80.0030.05020.43
5.5.350.0300.07720.40
5.5.340.0070.03318.10
5.5.330.0070.03720.33
5.5.320.0270.03320.38
5.5.310.0230.07720.27
5.5.300.0030.08718.08
5.5.290.0100.08018.04
5.5.280.0030.08720.87
5.5.270.0030.08720.68
5.5.260.0100.05020.88
5.5.250.0000.04720.66
5.5.240.0000.06020.26
5.4.450.0230.06019.64
5.4.440.0270.05019.32
5.4.430.0270.07319.40
5.4.420.0330.03719.51
5.4.410.0300.03719.39
5.4.400.0330.05319.32
5.4.390.0200.05319.31
5.4.380.0200.03719.22
5.4.370.0370.05718.99
5.4.360.0200.07019.31
5.4.350.0270.04319.22
5.4.340.0230.04319.14
5.4.320.0270.06719.22
5.4.310.0330.06319.14
5.4.300.0230.04318.99
5.4.290.0230.08019.10
5.4.280.0270.07319.13
5.4.270.0270.06318.87
5.4.260.0200.08018.87
5.4.250.0270.06719.21
5.4.240.0330.06719.13
5.4.230.0270.07019.05
5.4.220.0170.04719.13
5.4.210.0170.04719.14
5.4.200.0300.05019.14
5.4.190.0270.05319.18
5.4.180.0300.05018.98
5.4.170.0300.07319.14
5.4.160.0270.06019.07
5.4.150.0330.06719.13
5.4.140.0230.06016.45
5.4.130.0270.06316.40
5.4.120.0230.04716.54
5.4.110.0270.07016.63
5.4.100.0300.04316.57
5.4.90.0230.04716.61

preferences:
52.94 ms | 401 KiB | 5 Q