3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("ItemNew1.10", "Item2.5", "Item2.2", "Item4.50", "Item2.50", "Aluminum and glass windows.0", "Aluminum and glass windows.0","hgccg .2"); $tempArray = array(); $newArray = array(); foreach($array as $value) { list($item, ) = explode(".", $value); $int = filter_var($item, FILTER_SANITIZE_NUMBER_INT); if(!in_array($int, $tempArray)) { $newArray[] = $value; $tempArray[] = $int; } } print_r($newArray); ?>

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.0090.00618.43
8.3.50.0060.01122.12
8.3.40.0070.00718.82
8.3.30.0110.00419.29
8.3.20.0040.00420.26
8.3.10.0040.00423.53
8.3.00.0000.00819.25
8.2.180.0140.00316.59
8.2.170.0100.01022.96
8.2.160.0140.00020.40
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00422.22
8.2.110.0030.00622.08
8.2.100.0000.01217.63
8.2.90.0000.00919.22
8.2.80.0000.00917.97
8.2.70.0040.00817.38
8.2.60.0030.00618.16
8.2.50.0030.00518.07
8.2.40.0030.00619.72
8.2.30.0100.00018.17
8.2.20.0080.00017.62
8.2.10.0000.00718.07
8.2.00.0060.00317.70
8.1.280.0200.00025.92
8.1.270.0070.00023.79
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00323.92
8.1.230.0070.00419.07
8.1.220.0090.00017.76
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.13
8.1.180.0080.00318.10
8.1.170.0050.00318.58
8.1.160.0040.00421.99
8.1.150.0000.00718.84
8.1.140.0000.00717.35
8.1.130.0030.00317.73
8.1.120.0040.00417.38
8.1.110.0030.00617.44
8.1.100.0000.00717.49
8.1.90.0040.00417.41
8.1.80.0050.00217.41
8.1.70.0040.00417.42
8.1.60.0040.00417.60
8.1.50.0040.00417.50
8.1.40.0050.00317.40
8.1.30.0040.00417.71
8.1.20.0000.00717.56
8.1.10.0060.00317.49
8.1.00.0070.00017.39
8.0.300.0020.00518.77
8.0.290.0040.00416.75
8.0.280.0070.00018.46
8.0.270.0040.00417.31
8.0.260.0000.00817.20
8.0.250.0040.00416.82
8.0.240.0070.00016.90
8.0.230.0080.00016.80
8.0.220.0030.00316.89
8.0.210.0080.00016.88
8.0.200.0030.00316.81
8.0.190.0000.00816.95
8.0.180.0000.00716.82
8.0.170.0040.00416.97
8.0.160.0040.00416.98
8.0.150.0040.00416.89
8.0.140.0040.00416.80
8.0.130.0000.00613.32
8.0.120.0080.00016.80
8.0.110.0040.00416.82
8.0.100.0030.00316.73
8.0.90.0050.00316.82
8.0.80.0030.01616.89
8.0.70.0050.00216.88
8.0.60.0000.00716.87
8.0.50.0040.00416.92
8.0.30.0110.00917.25
8.0.20.0130.00617.40
8.0.10.0000.00717.04
8.0.00.0100.00716.78
7.4.330.0000.00515.20
7.4.320.0060.00316.64
7.4.300.0000.00616.50
7.4.290.0000.00716.41
7.4.280.0070.00016.57
7.4.270.0000.00716.57
7.4.260.0060.00316.62
7.4.250.0050.00316.57
7.4.240.0040.00416.49
7.4.230.0000.00716.65
7.4.220.0130.00616.60
7.4.210.0120.00616.52
7.4.200.0040.00416.50
7.4.160.0110.00616.77
7.4.150.0120.00617.40
7.4.140.0130.00417.86
7.4.130.0110.00616.59
7.4.120.0100.00816.51
7.4.110.0160.00316.70
7.4.100.0040.01216.58
7.4.90.0090.00916.61
7.4.80.0090.00919.39
7.4.70.0060.01116.54
7.4.60.0070.01016.51
7.4.50.0090.00016.35
7.4.40.0080.00816.50
7.4.30.0150.00316.21
7.4.00.0070.00714.62
7.3.330.0030.00313.16
7.3.320.0000.00513.20
7.3.310.0000.00616.26
7.3.300.0070.00016.37
7.3.290.0040.01116.31
7.3.280.0050.01116.34
7.3.270.0150.00617.40
7.3.260.0170.00316.38
7.3.250.0090.00816.51
7.3.240.0100.00716.21
7.3.230.0100.00716.39
7.3.210.0000.01716.29
7.3.200.0100.00519.39
7.3.190.0100.00716.45
7.3.180.0130.00716.38
7.3.170.0090.00916.30
7.3.160.0080.00816.59
7.3.10.0100.00616.46
7.3.00.0050.00916.45
7.2.330.0070.01016.55
7.2.320.0000.01816.60
7.2.310.0080.01116.70
7.2.300.0080.00816.49
7.2.290.0120.00416.62
7.2.130.0090.00716.52
7.2.120.0170.00716.34
7.2.110.0110.00616.75
7.2.100.0100.01016.85
7.2.90.0180.00716.58
7.2.80.0130.00616.54
7.2.70.0090.01316.65
7.2.60.0070.01816.58
7.2.50.0150.00616.83
7.2.40.0100.00716.64
7.2.30.0150.00916.98
7.2.20.0090.00716.71
7.2.10.0140.01016.52
7.2.00.0100.01217.70
7.1.250.0070.00815.41
7.1.100.0090.00318.26
7.1.70.0030.00317.21
7.1.60.0100.01419.11
7.1.50.0060.01616.86
7.1.00.0000.08022.45
7.0.200.0030.00716.94
7.0.140.0070.06722.18
7.0.60.0100.03319.91
7.0.50.0070.08017.86
7.0.40.0030.07020.09
7.0.30.0270.05020.23
7.0.20.0170.04320.19
7.0.10.0100.08720.25
7.0.00.0030.04320.06
5.6.280.0070.07020.89
5.6.210.0030.08020.72
5.6.200.0070.07718.24
5.6.190.0030.06720.42
5.6.180.0230.03020.50
5.6.170.0230.08320.45
5.6.160.0070.04320.44
5.6.150.0030.06718.16
5.6.140.0170.04018.14
5.6.130.0070.04018.32
5.6.120.0070.08020.99
5.6.110.0100.08320.97
5.6.100.0070.06321.00
5.6.90.0170.06020.95
5.6.80.0130.07720.50
5.6.70.4430.03020.36
5.5.350.0030.06020.49
5.5.340.0170.07017.95
5.5.330.0100.08020.36
5.5.320.0300.05020.24
5.5.310.0230.05020.26
5.5.300.0330.03018.03
5.5.290.0000.05717.98
5.5.280.0200.07720.86
5.5.270.0070.05320.86
5.5.260.0130.07720.65
5.5.250.0100.08020.77
5.5.240.0330.06020.18
5.4.450.1030.06019.47
5.4.440.0630.05719.41
5.4.430.0200.07019.17
5.4.420.0670.00019.52
5.4.410.0830.00019.27
5.4.400.0600.00019.16
5.4.390.0630.00019.21
5.4.380.0700.00019.02
5.4.370.0630.00019.25
5.4.360.0630.00019.21
5.4.350.0670.00019.11
5.4.340.0090.03912.00
5.4.320.0030.03812.49
5.4.310.0120.03712.48
5.4.300.0110.03112.49
5.4.290.0070.03712.48
5.4.280.0080.03112.38
5.4.270.0100.03712.38
5.4.260.0090.03312.38
5.4.250.0060.03612.38
5.4.240.0080.03312.38
5.4.230.0050.04012.37
5.4.220.0070.04312.37
5.4.210.0060.03512.37
5.4.200.0130.03812.38
5.4.190.0080.03712.37
5.4.180.0080.03712.37
5.4.170.0060.03512.38
5.4.160.0080.03212.38
5.4.150.0040.03712.38
5.4.140.0050.03712.06
5.4.130.0090.03812.04
5.4.120.0070.04112.00
5.4.110.0080.03412.00
5.4.100.0080.03312.00
5.4.90.0080.03712.00
5.4.80.0060.03812.00
5.4.70.0050.04411.99
5.4.60.0060.04812.00
5.4.50.0050.04312.00
5.4.40.0070.03411.98
5.4.30.0090.03311.98
5.4.20.0050.03811.98
5.4.10.0050.03711.98
5.4.00.0080.03511.47
5.3.290.0100.04112.80
5.3.280.0000.04512.71
5.3.270.0060.04012.72
5.3.260.0070.03912.71
5.3.250.0050.03812.72
5.3.240.0040.04012.72
5.3.230.0070.03712.71
5.3.220.0070.03712.68
5.3.210.0080.03712.68
5.3.200.0070.03612.68
5.3.190.0070.03712.68
5.3.180.0090.03512.68
5.3.170.0100.03412.67
5.3.160.0080.03812.67
5.3.150.0080.03612.67
5.3.140.0030.03912.66
5.3.130.0050.03912.66
5.3.120.0100.03412.66
5.3.110.0090.03512.66
5.3.100.0070.03512.12
5.3.90.0080.04012.09
5.3.80.0130.03012.08
5.3.70.0070.03512.08
5.3.60.0060.03912.06
5.3.50.0040.03612.02
5.3.40.0070.03412.02
5.3.30.0050.04111.97
5.3.20.0070.03411.75
5.3.10.0080.03111.71
5.3.00.0060.04011.70
5.2.170.0030.0329.21
5.2.160.0040.0299.21
5.2.150.0040.0319.20
5.2.140.0050.0299.20
5.2.130.0080.0259.16
5.2.120.0060.0269.17
5.2.110.0040.0299.18
5.2.100.0050.0299.17
5.2.90.0050.0299.17
5.2.80.0050.0299.16
5.2.70.0070.0279.16
5.2.60.0060.0289.11
5.2.50.0060.0299.08
5.2.40.0030.0319.06
5.2.30.0080.0279.04
5.2.20.0010.0329.03
5.2.10.0050.0288.93
5.2.00.0050.0308.80
5.1.60.0060.0228.07
5.1.50.0050.0248.07
5.1.40.0030.0268.05
5.1.30.0050.0258.40
5.1.20.0020.0338.42
5.1.10.0030.0308.14
5.1.00.0020.0278.14
5.0.50.0000.0236.62
5.0.40.0030.0256.48
5.0.30.0030.0306.30
5.0.20.0030.0286.26
5.0.10.0050.0176.24
5.0.00.0050.0376.24
4.4.90.0040.0184.78
4.4.80.0010.0164.75
4.4.70.0040.0144.75
4.4.60.0030.0144.76
4.4.50.0030.0144.77
4.4.40.0050.0224.71
4.4.30.0020.0154.75
4.4.20.0030.0144.85
4.4.10.0050.0124.85
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0040.0134.67
4.3.90.0020.0154.64
4.3.80.0040.0224.59
4.3.70.0030.0144.63
4.3.60.0050.0124.63
4.3.50.0040.0144.63
4.3.40.0020.0244.54
4.3.30.0010.0173.29
4.3.20.0040.0183.27
4.3.10.0020.0193.22
4.3.00.0170.0236.75

preferences:
40.41 ms | 401 KiB | 5 Q