3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr= [16,8,4,2,1]; $number = 13; $bin = str_split(str_pad(decbin($number),count($arr),"0",STR_PAD_LEFT)); Echo implode(",", array_intersect_key($arr,array_intersect($bin, ["1"])));

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.120.0110.00820.37
8.4.110.0120.00922.42
8.4.100.0130.00917.64
8.4.90.0110.01018.59
8.4.80.0110.00917.82
8.4.70.0120.00717.89
8.4.60.0060.00318.62
8.4.50.0100.00717.73
8.4.40.0060.01317.52
8.4.30.0080.00019.34
8.4.20.0070.01018.54
8.4.10.0100.01017.83
8.3.250.0140.00519.05
8.3.240.0100.00916.43
8.3.230.0100.00916.74
8.3.220.0040.00417.06
8.3.210.0120.00716.46
8.3.200.0150.00416.84
8.3.190.0050.00318.79
8.3.180.0130.00618.51
8.3.170.0130.00617.40
8.3.160.0070.01116.57
8.3.150.0080.01217.18
8.3.140.0060.00916.42
8.3.130.0030.00618.51
8.3.120.0080.00018.95
8.3.110.0060.00316.29
8.3.100.0040.00416.78
8.3.90.0030.00626.77
8.3.80.0030.00616.38
8.3.70.0110.00318.43
8.3.60.0090.00618.18
8.3.50.0090.00418.33
8.3.40.0110.01118.60
8.3.30.0150.00018.63
8.3.20.0050.00318.91
8.3.10.0080.00020.73
8.3.00.0050.00223.53
8.2.290.0060.00420.29
8.2.280.0100.00518.46
8.2.270.0090.00916.77
8.2.260.0090.00918.80
8.2.250.0040.00416.55
8.2.240.0030.00616.87
8.2.230.0000.00820.94
8.2.220.0090.00024.06
8.2.210.0110.00826.77
8.2.200.0030.00616.63
8.2.190.0140.00416.63
8.2.180.0140.00718.41
8.2.170.0130.00622.96
8.2.160.0090.00618.97
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.13
8.2.110.0040.00821.00
8.2.100.0110.00017.84
8.2.90.0000.00819.00
8.2.80.0040.00418.04
8.2.70.0040.00418.03
8.2.60.0050.00517.92
8.2.50.0080.00018.10
8.2.40.0040.00419.33
8.2.30.0000.00719.40
8.2.20.0040.00417.95
8.2.10.0020.00518.13
8.2.00.0070.00019.40
8.1.330.0120.00621.91
8.1.320.0050.00316.19
8.1.310.0130.00616.73
8.1.300.0030.00517.83
8.1.290.0030.00618.88
8.1.280.0090.00625.92
8.1.270.0040.00423.78
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0060.00322.63
8.1.230.0070.00317.64
8.1.220.0040.00417.88
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0060.00617.23
8.1.180.0060.00318.10
8.1.170.0000.00818.66
8.1.160.0020.00518.87
8.1.150.0000.00718.90
8.1.140.0070.00017.70
8.1.130.0030.00318.94
8.1.120.0040.00417.43
8.1.110.0000.01017.27
8.1.100.0040.00417.46
8.1.90.0040.00417.32
8.1.80.0030.00617.36
8.1.70.0000.00717.44
8.1.60.0080.00317.45
8.1.50.0000.00817.51
8.1.40.0020.00517.48
8.1.30.0050.00317.59
8.1.20.0040.00417.52
8.1.10.0000.00817.46
8.1.00.0000.00717.44
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.38
8.0.270.0080.00017.24
8.0.260.0040.00417.12
8.0.250.0030.00316.96
8.0.240.0070.00016.87
8.0.230.0000.00716.87
8.0.220.0040.00416.83
8.0.210.0070.00016.74
8.0.200.0000.00616.76
8.0.190.0000.00816.75
8.0.180.0040.00416.81
8.0.170.0050.00316.87
8.0.160.0070.00016.93
8.0.150.0070.00016.79
8.0.140.0040.00416.67
8.0.130.0000.00613.29
8.0.120.0070.00016.74
8.0.110.0080.00016.79
8.0.100.0040.00416.86
8.0.90.0000.00816.92
8.0.80.0110.00516.87
8.0.70.0000.00716.67
8.0.60.0000.00716.77
8.0.50.0000.00716.66
8.0.30.0110.00916.95
8.0.20.0120.00717.40
8.0.10.0000.00817.03
8.0.00.0100.00716.73
7.4.330.0050.00015.55
7.4.320.0000.00716.58
7.4.300.0000.00616.59
7.4.290.0030.00316.61
7.4.280.0040.00416.57
7.4.270.0030.00616.48
7.4.260.0050.00316.46
7.4.250.0030.00316.55
7.4.240.0030.00316.53
7.4.230.0000.00816.53
7.4.220.0050.00316.54
7.4.210.0070.00716.50
7.4.200.0070.00016.58
7.4.160.0080.01016.46
7.4.140.0130.00817.86
7.4.130.0120.00616.55
7.4.120.0110.00816.47
7.4.110.0060.01216.52
7.4.100.0060.00916.45
7.4.90.0160.00016.49
7.4.80.0130.01019.39
7.4.70.0070.01016.61
7.4.60.0120.00616.49
7.4.50.0070.00716.57
7.4.40.0140.00316.48
7.4.00.0090.00915.10
7.3.330.0030.00313.03
7.3.320.0020.00313.04
7.3.310.0000.00716.04
7.3.300.0000.00716.18
7.3.290.0070.00016.19
7.3.280.0080.01016.16
7.3.260.0070.01016.34
7.3.240.0080.00916.44
7.3.230.0130.01316.23
7.3.210.0090.00916.35
7.3.200.0060.01016.15
7.3.190.0070.01116.14
7.3.180.0040.01116.21
7.3.170.0100.00716.53
7.3.160.0060.00916.26
7.3.10.0120.00616.53
7.3.00.0090.00916.60
7.2.330.0090.00916.68
7.2.320.0080.01516.66
7.2.310.0060.01316.63
7.2.300.0130.00416.40
7.2.290.0090.01216.74
7.2.130.0250.00316.65
7.2.120.0110.00316.83
7.2.110.0060.00816.67
7.2.100.0070.00416.82
7.2.90.0120.00316.96
7.2.80.0070.00716.99
7.2.70.0140.00815.98
7.2.60.0130.00716.01
7.2.50.0130.00815.90
7.2.40.0120.00715.87
7.2.30.0100.01016.00
7.2.20.0120.01215.88
7.2.10.0150.00715.91
7.2.00.0150.00816.05
7.1.250.0110.00715.91
7.1.200.0000.01415.63
7.1.170.0200.00813.55
7.1.160.0190.01013.91
7.1.150.0220.00614.03
7.1.140.0240.00613.76
7.1.130.0210.00713.61
7.1.120.0340.00813.79
7.1.110.0310.01413.75
7.1.100.0770.01013.94
7.1.90.0220.00713.84
7.1.80.0210.01013.86
7.1.70.0580.00713.90
7.1.60.0450.00631.57
7.1.50.0500.00331.67
7.1.40.0300.02131.76
7.1.30.0430.01331.91
7.1.20.0440.01031.60
7.1.10.0310.00413.47
7.1.00.0220.00913.60

preferences:
37.27 ms | 403 KiB | 5 Q