3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cidr_match($ip, $range){ list ($subnet, $bits) = explode('/', $range); if ($bits === null) { $bits = 32; } $ip = ip2long($ip); $subnet = ip2long($subnet); $mask = -1 << (32 - $bits); $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned return ($ip & $mask) == $subnet; } var_dump(cidr_match('79.142.17.1', '79.142.16.0/20')); var_dump(cidr_match('79.142.35.4', '79.142.16.0/20'));

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.4.130.0080.01417.84
8.4.120.0120.00820.49
8.4.110.0110.01018.96
8.4.100.0070.00218.01
8.4.90.0100.00918.77
8.4.80.0060.00317.80
8.4.70.0040.00617.75
8.4.60.0110.00918.89
8.4.50.0080.01220.61
8.4.40.0130.00618.82
8.4.30.0090.00020.57
8.4.20.0160.00419.54
8.4.10.0030.00622.32
8.3.260.0040.00516.68
8.3.250.0060.00518.88
8.3.240.0070.00316.55
8.3.230.0120.00716.69
8.3.220.0060.00217.34
8.3.210.0090.00918.56
8.3.200.0020.00716.49
8.3.190.0070.01217.11
8.3.180.0100.00618.50
8.3.170.0100.01016.97
8.3.160.0100.00016.86
8.3.150.0070.01120.77
8.3.140.0150.00317.16
8.3.130.0080.00018.25
8.3.120.0090.00018.91
8.3.110.0060.00320.94
8.3.100.0090.00918.50
8.3.90.0080.00026.77
8.3.80.0040.00416.75
8.3.70.0110.00716.58
8.3.60.0110.00416.74
8.3.50.0110.00420.46
8.3.40.0090.00621.91
8.3.30.0120.00318.71
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0050.00226.16
8.2.290.0090.01120.55
8.2.280.0150.00318.26
8.2.270.0070.01117.26
8.2.260.0040.00416.48
8.2.250.0040.00420.69
8.2.240.0070.00719.25
8.2.230.0040.00422.58
8.2.220.0040.00424.06
8.2.210.0060.00326.77
8.2.200.0090.00016.75
8.2.190.0070.01116.75
8.2.180.0110.00425.92
8.2.170.0110.00422.96
8.2.160.0110.00422.96
8.2.150.0070.00025.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.21
8.2.110.0070.00322.39
8.2.100.0080.00317.72
8.2.90.0040.00417.88
8.2.80.0050.00318.93
8.2.70.0000.00817.63
8.2.60.0050.00317.75
8.2.50.0040.00418.04
8.2.40.0040.00418.16
8.2.30.0030.00518.11
8.2.20.0000.00720.49
8.2.10.0000.00718.05
8.2.00.0030.00619.23
8.1.330.0110.01022.22
8.1.320.0150.00715.98
8.1.310.0030.00620.35
8.1.300.0000.00820.11
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00320.29
8.1.230.0070.00317.76
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0000.01017.35
8.1.190.0080.00017.13
8.1.180.0080.00018.10
8.1.170.0040.00417.65
8.1.160.0070.00018.84
8.1.150.0050.00218.70
8.1.140.0040.00417.45
8.1.130.0030.00617.50
8.1.120.0000.00717.45
8.1.110.0040.00417.41
8.1.100.0040.00417.50
8.1.90.0040.00417.56
8.1.80.0110.00417.40
8.1.70.0120.00417.38
8.1.60.0150.00317.65
8.1.50.0090.00617.50
8.1.40.0140.00417.55
8.1.30.0120.00517.61
8.1.20.0140.00417.62
8.1.10.0120.00817.58
8.1.00.0140.00417.51
8.0.300.0000.00718.77
8.0.290.0060.00316.63
8.0.280.0000.00718.34
8.0.270.0000.00716.77
8.0.260.0000.00616.80
8.0.250.0030.00317.00
8.0.240.0060.00016.90
8.0.230.0000.00717.05
8.0.220.0040.00416.95
8.0.210.0090.00516.91
8.0.200.0110.00516.96
8.0.190.0120.00316.93
8.0.180.0110.00416.87
8.0.170.0060.00816.90
8.0.160.0110.00516.90
8.0.150.0120.00516.85
8.0.140.0120.00416.79
8.0.130.0120.00416.89
8.0.120.0110.00316.87
8.0.110.0100.00516.84
8.0.100.0130.00316.95
8.0.90.0110.00416.92
8.0.80.0110.00416.87
8.0.70.0090.00516.82
8.0.60.0090.00516.86
8.0.50.0050.00816.85
8.0.30.0110.00417.00
8.0.20.0120.00316.97
8.0.10.0080.00717.02
7.4.330.0000.00515.55
7.4.320.0000.00616.55
7.4.300.0100.00716.54
7.4.290.0100.00416.54
7.4.280.0120.00216.56
7.4.270.0060.00716.58
7.4.260.0100.00416.53
7.4.250.0090.00616.62
7.4.240.0100.00716.53
7.4.230.0080.00716.60
7.4.220.0090.00516.63
7.4.210.0080.00516.59
7.4.200.0070.00616.56
7.4.190.0100.00516.57
7.4.180.0080.00616.61
7.4.160.0090.00516.55
7.4.150.0080.00616.48
7.4.140.0110.00316.48
7.4.130.0080.00516.53
7.4.120.0110.00316.54
7.4.110.0100.00516.45
7.4.100.0100.00316.52
7.4.90.0070.00816.42
7.4.80.0070.00716.47
7.4.70.0080.00416.46
7.4.60.0090.00416.46
7.4.50.0090.00516.40
7.4.40.0080.00516.41
7.4.30.0090.00416.45
7.4.20.0110.00216.41
7.4.10.0110.00316.43
7.4.00.0100.00316.55

preferences:
26.88 ms | 403 KiB | 5 Q