3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowed = ['Visa', 'Mastercard']; /** Make allowed all lowercase **/ $allowedLower = array_map(function($type) { return strtolower($type); }, $allowed); $cardsGiven = 'Visa,Mastercard,Mint'; $cardsAccepted = []; $data = explode(',', $cardsGiven); foreach ($data as $type) { if (in_array(strtolower($type), $allowedLower)) { $cardsAccepted[] = $type; } } print_r($cardsAccepted);

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.30.0110.00620.24
8.5.20.0090.00820.38
8.5.10.0080.00820.07
8.5.00.0110.00919.90
8.4.180.0130.01019.62
8.4.170.0100.01223.79
8.4.160.0090.01224.02
8.4.150.0090.00416.87
8.4.140.0130.00817.70
8.4.130.0130.00717.45
8.4.120.0110.01020.83
8.4.110.0080.01318.96
8.4.100.0070.01217.70
8.4.90.0080.00520.52
8.4.80.0100.00918.89
8.4.70.0060.00318.71
8.4.60.0170.00618.60
8.4.50.0140.00718.49
8.4.40.0070.01124.07
8.4.30.0090.00922.08
8.4.20.0110.00717.58
8.4.10.0040.00817.92
8.3.300.0110.00920.14
8.3.290.0130.01220.65
8.3.280.0040.00418.46
8.3.270.0170.00716.82
8.3.260.0090.01116.58
8.3.250.0040.00518.86
8.3.240.0040.00416.77
8.3.230.0100.00916.77
8.3.220.0030.00518.97
8.3.210.0060.00218.52
8.3.200.0030.00516.74
8.3.190.0140.00517.05
8.3.180.0110.00817.30
8.3.170.0180.00019.05
8.3.160.0070.01117.18
8.3.150.0150.00020.66
8.3.140.0030.00518.39
8.3.130.0040.00416.56
8.3.120.0070.01118.96
8.3.110.0040.00416.49
8.3.100.0030.00616.79
8.3.90.0050.00326.77
8.3.80.0090.00019.36
8.3.70.0090.00916.63
8.3.60.0070.00718.55
8.3.50.0090.01123.03
8.3.40.0120.00618.55
8.3.30.0140.00318.59
8.3.20.0060.01121.92
8.3.10.0070.00021.81
8.3.00.0080.00019.84
8.2.300.0120.00718.79
8.2.290.0070.01016.43
8.2.280.0100.00518.45
8.2.270.0100.00718.85
8.2.260.0050.00318.19
8.2.250.0110.00418.52
8.2.240.0030.00616.78
8.2.230.0100.00020.94
8.2.220.0040.01224.06
8.2.210.0130.00626.77
8.2.200.0040.00418.88
8.2.190.0090.00618.50
8.2.180.0070.01116.50
8.2.170.0140.00718.91
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00422.26
8.2.120.0050.00326.35
8.2.110.0040.00420.87
8.2.100.0080.00417.90
8.2.90.0080.00019.14
8.2.80.0060.00317.97
8.2.70.0030.00517.63
8.2.60.0040.00417.91
8.2.50.0040.00818.10
8.2.40.0030.00522.24
8.2.30.0040.00421.16
8.2.20.0040.00417.62
8.2.10.0040.00418.14
8.2.00.0040.00417.99
8.1.340.0110.00719.80
8.1.330.0130.00616.19
8.1.320.0090.00615.98
8.1.310.0150.00318.35
8.1.300.0160.00018.41
8.1.290.0040.00430.84
8.1.280.0100.00725.92
8.1.270.0050.00323.73
8.1.260.0090.00028.09
8.1.250.0040.00428.09
8.1.240.0040.00423.92
8.1.230.0080.00422.82
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0030.00617.48
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0000.00818.55
8.1.160.0000.00722.13
8.1.150.0020.00520.56
8.1.140.0000.00719.55
8.1.130.0030.00517.70
8.1.120.0040.00417.50
8.1.110.0080.00017.49
8.1.100.0000.00717.44
8.1.90.0070.00317.50
8.1.80.0030.00517.47
8.1.70.0050.00317.50
8.1.60.0000.00717.60
8.1.50.0000.00817.47
8.1.40.0040.00417.53
8.1.30.0080.00017.64
8.1.20.0070.00017.52
8.1.10.0080.00017.35
8.1.00.0040.00417.27
8.0.300.0060.00319.86
8.0.290.0030.00516.75
8.0.280.0000.00718.43
8.0.270.0050.00317.16
8.0.260.0030.00317.15
8.0.250.0000.00616.82
8.0.240.0070.00016.86
8.0.230.0030.00316.81
8.0.220.0070.00016.91
8.0.210.0060.00016.84
8.0.200.0040.00416.98
8.0.190.0000.00716.86
8.0.180.0000.00716.95
8.0.170.0040.00416.84
8.0.160.0080.00016.84
8.0.150.0000.00716.81
8.0.140.0040.00416.86
8.0.130.0050.00013.27
8.0.120.0040.00416.82
8.0.110.0040.00416.91
8.0.100.0040.00416.86
8.0.90.0030.00316.94
8.0.80.0100.01016.89
8.0.70.0040.00416.99
8.0.60.0000.00716.85
8.0.50.0000.00716.78
8.0.30.0130.00716.99
8.0.20.0090.01017.40
8.0.10.0050.00317.00
8.0.00.0100.00616.77
7.4.330.0000.00515.09
7.4.320.0030.00316.50
7.4.300.0030.00316.50
7.4.290.0000.00916.50
7.4.280.0000.00816.54
7.4.270.0000.00616.57
7.4.260.0030.00316.40
7.4.250.0030.00316.36
7.4.240.0000.00716.63
7.4.230.0070.00016.59
7.4.220.0130.00916.63
7.4.210.0100.00616.53
7.4.200.0030.00316.50
7.4.160.0080.00816.41
7.4.150.0090.00917.40
7.4.140.0110.01217.86
7.4.130.0120.00416.56
7.4.120.0120.00516.50
7.4.110.0110.00916.46
7.4.100.0140.00616.37
7.4.90.0090.00916.66
7.4.80.0120.00919.39
7.4.70.0000.01516.55
7.4.60.0090.00616.50
7.4.50.0100.00316.31
7.4.40.0060.01016.53
7.4.30.0040.01316.50
7.4.00.0100.00615.01
7.3.330.0060.00013.10
7.3.320.0020.00313.29
7.3.310.0000.00816.32
7.3.300.0000.00716.22
7.3.290.0070.00016.18
7.3.280.0100.01016.27
7.3.270.0080.01117.40
7.3.260.0090.00816.53
7.3.250.0120.00816.28
7.3.240.0080.00916.37
7.3.230.0030.01416.39
7.3.210.0070.01016.52
7.3.200.0040.01516.28
7.3.190.0030.01416.66
7.3.180.0100.01016.45
7.3.170.0030.01416.33
7.3.160.0160.00316.57
7.2.330.0190.00316.50
7.2.320.0040.01716.73
7.2.310.0110.00616.67
7.2.300.0080.00816.43
7.2.290.0070.01116.46
7.2.60.0040.01216.63
7.2.00.0070.00719.58
7.1.200.0060.00615.89
7.1.70.0000.01016.91
7.1.60.0040.00719.75
7.1.00.0030.07722.35
7.0.200.0030.00716.86
7.0.90.0200.07319.94
7.0.80.0000.07020.00
7.0.70.0070.06320.10
7.0.60.1030.05020.07
7.0.50.0070.06320.32
7.0.40.0130.05720.40
7.0.30.0070.06720.31
7.0.20.0200.06720.35
7.0.10.0230.07320.43
7.0.00.0230.06020.35
5.6.230.0070.06320.68
5.6.220.0000.07020.61
5.6.210.0200.05720.54
5.6.200.0170.06721.09
5.6.190.0230.05321.16
5.6.180.0200.06321.11
5.6.170.0030.07721.10
5.6.160.0170.06321.09
5.6.150.0070.06721.09
5.6.140.0200.06021.08
5.6.130.0270.05721.08
5.6.120.0100.08021.02
5.6.110.0230.07021.02
5.6.100.0100.06321.19
5.6.90.0200.07321.07
5.6.80.0130.05720.59
5.6.70.0170.05720.47
5.6.60.0330.04020.48
5.6.50.0100.07020.56
5.6.40.0170.06720.43
5.6.30.0170.07320.37
5.6.20.0130.06020.47
5.6.10.0170.06020.46
5.6.00.0130.06320.36

preferences:
105.14 ms | 1476 KiB | 5 Q