3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Surprise surprise! When the 2nd array param of array_diff() contains an elemant with value false, // the result will no longer contain null values. function myIsset($value) { return isset($value); } $arrayWithTrueValue = array( 'null1' => null, 'null2' => null, 'bool' => true, ); $filteredArray = array_filter($arrayWithTrueValue, 'myIsset'); echo "\$arrayWithTrueValue has three elements..\n"; var_dump($arrayWithTrueValue); echo "\$filteredArray has one element (only isset(true) === true)\n"; var_dump($filteredArray); echo "so the difference is an array with two elements..\n"; var_dump(array_diff($arrayWithTrueValue, $filteredArray)); $arrayWithFalseValue = $arrayWithTrueValue; $arrayWithFalseValue['bool'] = false; $filteredArrayWithOnlyFalse = array_filter($arrayWithFalseValue, 'myIsset'); var_dump($arrayWithFalseValue, $filteredArrayWithOnlyFalse, array_diff($arrayWithFalseValue, $filteredArrayWithOnlyFalse));

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.0160.00618.29
8.3.50.0060.01121.93
8.3.40.0160.00018.79
8.3.30.0060.00818.84
8.3.20.0050.00320.29
8.3.10.0000.00822.13
8.3.00.0080.00022.58
8.2.180.0080.00816.88
8.2.170.0150.00022.96
8.2.160.0040.01121.08
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0050.00319.48
8.2.110.0030.00720.89
8.2.100.0120.00018.03
8.2.90.0050.00319.36
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0040.00417.91
8.2.50.0060.00318.07
8.2.40.0060.00318.34
8.2.30.0040.00418.08
8.2.20.0000.00717.77
8.2.10.0040.00417.78
8.2.00.0060.00317.63
8.1.280.0150.00025.92
8.1.270.0080.00023.64
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00621.42
8.1.230.0070.00717.52
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0080.00017.10
8.1.180.0030.00518.10
8.1.170.0040.00418.50
8.1.160.0030.00621.97
8.1.150.0030.00318.51
8.1.140.0040.00417.42
8.1.130.0070.00017.86
8.1.120.0000.00717.48
8.1.110.0050.00217.35
8.1.100.0040.00417.41
8.1.90.0030.00517.31
8.1.80.0000.00717.32
8.1.70.0080.00017.41
8.1.60.0030.00617.59
8.1.50.0000.00717.45
8.1.40.0030.00617.46
8.1.30.0060.00317.51
8.1.20.0030.00617.47
8.1.10.0040.00417.50
8.1.00.0000.00717.59
8.0.300.0050.00218.77
8.0.290.0000.00816.75
8.0.280.0030.00318.45
8.0.270.0050.00217.29
8.0.260.0000.00618.49
8.0.250.0030.00316.90
8.0.240.0000.00716.86
8.0.230.0030.00316.91
8.0.220.0050.00216.76
8.0.210.0030.00316.77
8.0.200.0000.00716.89
8.0.190.0000.00716.95
8.0.180.0000.00816.77
8.0.170.0030.00616.89
8.0.160.0040.00416.96
8.0.150.0000.01016.83
8.0.140.0050.00316.75
8.0.130.0000.00813.34
8.0.120.0050.00316.92
8.0.110.0000.00816.77
8.0.100.0040.00416.80
8.0.90.0050.00316.97
8.0.80.0060.01216.82
8.0.70.0000.00816.89
8.0.60.0040.00416.67
8.0.50.0070.00016.86
8.0.30.0100.01117.16
8.0.20.0110.00917.40
8.0.10.0030.00516.98
8.0.00.0080.01316.77
7.4.330.0030.00315.08
7.4.320.0000.00616.49
7.4.300.0030.00316.60
7.4.290.0000.00816.46
7.4.280.0030.00316.57
7.4.270.0070.00316.48
7.4.260.0030.00316.47
7.4.250.0040.00416.46
7.4.240.0040.00316.49
7.4.230.0050.00316.36
7.4.220.0140.00316.59
7.4.210.0070.01016.61
7.4.200.0050.00316.50
7.4.190.0050.00216.75
7.4.160.0130.00316.52
7.4.150.0150.00417.40
7.4.140.0120.00617.86
7.4.130.0080.01316.42
7.4.120.0090.00816.48
7.4.110.0090.00916.35
7.4.100.0070.01016.45
7.4.90.0120.01216.62
7.4.80.0090.00919.39
7.4.70.0120.00616.38
7.4.60.0060.00916.36
7.4.50.0030.00616.50
7.4.40.0070.00722.77
7.4.30.0100.01016.51
7.4.00.0030.01414.75
7.3.330.0060.00013.29
7.3.320.0000.00613.22
7.3.310.0000.00616.22
7.3.300.0030.00316.23
7.3.290.0090.00816.18
7.3.280.0100.00616.30
7.3.270.0060.01417.40
7.3.260.0100.01316.56
7.3.250.0140.00316.52
7.3.240.0070.01016.25
7.3.230.0110.01216.39
7.3.210.0110.01116.24
7.3.200.0120.01119.39
7.3.190.0100.00716.54
7.3.180.0150.00716.15
7.3.170.0110.00616.48
7.3.160.0060.01016.39
7.3.120.0040.01114.89
7.2.330.0120.00616.59
7.2.320.0100.01016.75
7.2.310.0070.01116.64
7.2.300.0150.00316.42
7.2.290.0150.00616.70
7.2.60.0100.00316.63
7.2.00.0060.00919.54
7.1.200.0030.01015.65
7.1.100.0240.01217.45
7.1.70.0040.00417.13
7.1.60.0070.01019.82
7.1.50.0040.00716.57
7.1.00.0070.07022.36
7.0.200.0070.00716.74
7.0.140.0100.06722.11
7.0.80.0230.04319.95
7.0.70.0130.03719.97
7.0.60.0100.04019.97
7.0.50.0100.04720.18
7.0.40.0000.04719.95
7.0.30.0000.05020.04
7.0.20.0030.06320.14
7.0.10.0030.04320.18
7.0.00.0070.04020.04
5.6.280.0030.07321.07
5.6.230.0170.07320.69
5.6.220.0070.04320.58
5.6.210.0030.04020.58
5.6.200.0130.03321.03
5.6.190.0070.04021.05
5.6.180.0000.04321.00
5.6.170.0030.04320.96
5.6.160.0070.04021.08
5.6.150.0070.04021.14
5.6.140.0070.03321.17
5.6.130.0030.07321.03
5.6.120.0030.04321.10
5.6.110.0030.04721.00
5.6.100.0030.04321.03
5.6.90.0100.05321.05
5.6.80.0000.03720.45
5.6.70.0130.03020.40
5.6.60.0100.03320.44
5.6.50.0100.03020.35
5.6.40.0030.04020.40
5.6.30.0070.05320.38
5.6.20.0000.08020.43
5.6.10.0070.04020.34
5.6.00.0100.07320.30
5.5.370.0000.08720.43
5.5.360.0070.04020.44
5.5.350.0100.05020.46
5.5.340.0030.04320.93
5.5.330.0070.04020.81
5.5.320.0000.04720.83
5.5.310.0000.04720.86
5.5.300.0070.04020.92
5.5.290.0100.03720.78
5.5.280.0100.03720.61
5.5.270.0030.04320.77
5.5.260.0130.03020.92
5.5.250.0070.04020.72
5.5.240.0070.03020.12
5.5.230.0000.04320.24
5.5.220.0070.03720.29
5.5.210.0030.03320.25
5.5.200.0070.03020.28
5.5.190.0100.04720.24
5.5.180.0030.04320.00
5.5.160.0030.04020.08
5.5.150.0030.03720.11
5.5.140.0070.08720.27
5.5.130.0070.07720.14
5.5.120.0170.07020.28
5.5.110.0100.08320.15
5.5.100.0000.08020.18
5.5.90.0070.04020.00
5.5.80.0070.08020.15
5.5.70.0030.04720.09
5.5.60.0070.05020.04
5.5.50.0070.04720.10
5.5.40.0100.03720.06
5.5.30.0030.07719.95
5.5.20.0070.04719.95
5.5.10.0100.07720.07
5.5.00.0130.07020.07
5.4.450.0070.03719.29
5.4.440.0070.03719.50
5.4.430.0070.03019.47
5.4.420.0070.03719.45
5.4.410.0070.03719.24
5.4.400.0030.04019.04
5.4.390.0000.04319.04
5.4.380.0030.03719.03
5.4.370.0000.04018.88
5.4.360.0030.03319.13
5.4.350.0100.03319.16
5.4.340.0000.07319.05
5.4.320.0100.07019.05
5.4.310.0070.07718.90
5.4.300.0100.06319.13
5.4.290.0030.08018.94
5.4.280.0130.07319.14
5.4.270.0130.07018.94
5.4.260.0030.04719.22
5.4.250.0070.03719.03
5.4.240.0200.06019.12
5.4.230.0070.07319.07
5.4.220.0030.07718.90
5.4.210.0030.04319.13
5.4.200.0070.06319.08
5.4.190.0030.06318.83
5.4.180.0030.07019.04
5.4.170.0130.05319.04
5.4.160.0100.06719.07
5.4.150.0130.07319.11
5.4.140.0100.07316.42
5.4.130.0070.06016.43
5.4.120.0100.03716.43
5.4.110.0130.03716.46
5.4.100.0100.03716.42
5.4.90.0100.07316.50
5.4.80.0070.04316.41
5.4.70.0130.07016.49
5.4.60.0130.06316.32
5.4.50.0130.06716.24
5.4.40.0100.06316.35
5.4.30.0100.03716.33
5.4.20.0070.07016.31
5.4.10.0030.08016.41
5.4.00.0070.06315.86
5.3.290.0000.04314.72
5.3.280.0100.05714.64
5.3.270.0030.07014.61
5.3.260.0070.04314.66
5.3.250.0130.03714.72
5.3.240.0070.04014.67
5.3.230.0100.03714.54
5.3.220.0170.06314.57
5.3.210.0100.07314.58
5.3.200.0130.07014.58
5.3.190.0030.07714.62
5.3.180.0070.04314.66
5.3.170.0070.05314.56
5.3.160.0070.04314.57
5.3.150.0130.05714.70
5.3.140.0030.06014.62
5.3.130.0000.08314.69
5.3.120.0070.07014.61
5.3.110.0100.05014.61
5.3.100.0070.04714.13
5.3.90.0030.04314.02
5.3.80.0170.06314.07
5.3.70.0000.07714.15
5.3.60.0030.05713.91
5.3.50.0030.04313.85
5.3.40.0030.04713.92
5.3.30.0100.03713.79
5.3.20.0070.03313.80
5.3.10.0100.05313.67
5.3.00.0070.05313.57
5.2.170.0100.03313.57
5.2.160.0000.04013.57
5.2.150.0070.03313.57
5.2.140.0030.05313.57
5.2.130.0000.04713.57
5.2.120.0070.04013.57
5.2.110.0030.06313.57
5.2.100.0000.07013.57
5.2.90.0070.03313.57
5.2.80.0100.06013.57
5.2.70.0070.06313.57
5.2.60.0070.06713.57
5.2.50.0030.06313.57
5.2.40.0000.05013.57
5.2.30.0100.03713.57
5.2.20.0030.06713.57
5.2.10.0100.04013.57
5.2.00.0100.06713.57
5.1.60.0100.02313.57
5.1.50.0100.03013.57
5.1.40.0070.05313.57
5.1.30.0000.04013.57
5.1.20.0030.04013.57
5.1.10.0030.04313.57
5.1.00.0070.05013.57
5.0.50.0070.04013.57
5.0.40.0030.04313.57
5.0.30.0000.05313.57
5.0.20.0030.04313.57
5.0.10.0030.03313.57
5.0.00.0030.06313.57
4.4.90.0030.03313.57
4.4.80.0070.02713.57
4.4.70.0000.02013.57
4.4.60.0000.03713.57
4.4.50.0130.02713.57
4.4.40.0000.04013.57
4.4.30.0030.03713.57
4.4.20.0030.03713.57
4.4.10.0000.02013.57
4.4.00.0000.05013.57
4.3.110.0030.03713.57
4.3.100.0000.03713.57
4.3.90.0030.03313.57
4.3.80.0000.02713.57
4.3.70.0000.03713.57
4.3.60.0070.02313.57
4.3.50.0000.03313.57
4.3.40.0100.03713.57
4.3.30.0030.03313.57
4.3.20.0070.03013.57
4.3.10.0000.03313.57
4.3.00.0000.03013.57

preferences:
42.14 ms | 401 KiB | 5 Q