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.0110.00416.75
8.3.50.0170.00221.88
8.3.40.0030.01218.98
8.3.30.0070.00719.04
8.3.20.0040.00420.34
8.3.10.0040.00423.64
8.3.00.0030.00519.50
8.2.180.0110.00718.36
8.2.170.0110.00422.96
8.2.160.0030.01020.38
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.25
8.2.110.0030.00620.43
8.2.100.0000.01217.91
8.2.90.0040.00419.39
8.2.80.0000.00817.97
8.2.70.0060.00317.75
8.2.60.0050.00318.05
8.2.50.0030.00618.07
8.2.40.0060.00319.88
8.2.30.0000.00818.04
8.2.20.0040.00417.73
8.2.10.0000.00818.21
8.2.00.0070.00017.75
8.1.280.0040.01125.92
8.1.270.0000.00923.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0100.00023.85
8.1.230.0060.00623.93
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.01117.35
8.1.190.0060.00317.10
8.1.180.0080.00018.10
8.1.170.0080.00018.44
8.1.160.0000.00721.98
8.1.150.0050.00218.54
8.1.140.0050.00317.51
8.1.130.0000.00717.91
8.1.120.0000.00717.48
8.1.110.0090.00017.34
8.1.100.0040.00417.30
8.1.90.0000.00717.40
8.1.80.0000.00717.44
8.1.70.0000.00717.39
8.1.60.0030.00617.46
8.1.50.0060.00317.47
8.1.40.0060.00317.45
8.1.30.0030.00517.55
8.1.20.0040.00417.55
8.1.10.0080.00017.50
8.1.00.0060.00317.53
8.0.300.0000.00818.77
8.0.290.0000.00717.04
8.0.280.0000.00718.46
8.0.270.0030.00317.32
8.0.260.0000.00617.29
8.0.250.0030.00317.06
8.0.240.0060.00317.07
8.0.230.0070.00017.10
8.0.220.0000.00716.87
8.0.210.0000.00716.86
8.0.200.0070.00017.04
8.0.190.0040.00416.93
8.0.180.0000.00816.98
8.0.170.0050.00316.96
8.0.160.0050.00217.01
8.0.150.0040.00416.93
8.0.140.0040.00416.94
8.0.130.0000.00613.38
8.0.120.0000.00916.91
8.0.110.0040.00417.00
8.0.100.0000.00716.77
8.0.90.0040.00417.02
8.0.80.0100.00716.94
8.0.70.0040.00416.77
8.0.60.0000.00816.84
8.0.50.0000.00717.02
8.0.30.0120.00816.99
8.0.20.0090.01017.40
8.0.10.0040.00416.83
8.0.00.0110.01216.97
7.4.330.0030.00315.04
7.4.320.0080.00016.53
7.4.300.0030.00316.57
7.4.290.0080.00016.55
7.4.280.0070.00016.59
7.4.270.0050.00316.38
7.4.260.0030.00316.55
7.4.250.0040.00416.54
7.4.240.0030.00416.52
7.4.230.0030.00316.64
7.4.220.0110.00716.68
7.4.210.0050.00816.54
7.4.200.0070.00016.50
7.4.190.0070.00016.61
7.4.160.0150.00016.35
7.4.150.0210.00017.40
7.4.140.0130.00817.86
7.4.130.0070.01116.50
7.4.120.0110.00616.46
7.4.110.0190.00516.34
7.4.100.0150.00316.67
7.4.90.0140.00316.71
7.4.80.0140.00719.39
7.4.70.0000.01816.64
7.4.60.0110.00616.61
7.4.50.0000.00816.57
7.4.40.0060.01116.43
7.4.30.0090.00616.52
7.4.10.0090.00914.82
7.4.00.0080.01015.07
7.3.330.0000.00613.17
7.3.320.0000.00613.40
7.3.310.0000.00716.37
7.3.300.0030.00416.32
7.3.290.0060.00816.37
7.3.280.0070.01016.38
7.3.270.0090.00817.40
7.3.260.0130.00416.39
7.3.250.0120.00416.55
7.3.240.0030.01516.50
7.3.230.0130.00716.43
7.3.210.0090.01216.52
7.3.200.0110.01119.39
7.3.190.0210.00316.44
7.3.180.0100.00716.57
7.3.170.0100.00716.50
7.3.160.0070.01016.55
7.3.130.0030.01314.92
7.3.120.0080.00814.89
7.3.110.0030.01514.82
7.3.100.0030.01014.68
7.3.90.0110.00414.92
7.3.80.0040.00814.86
7.3.70.0110.00414.81
7.3.60.0080.00314.92
7.3.50.0090.00614.89
7.3.40.0060.01014.71
7.3.30.0000.01114.88
7.3.20.0030.00716.52
7.3.10.0040.01116.75
7.3.00.0070.00716.80
7.2.330.0090.00916.79
7.2.320.0060.01116.55
7.2.310.0090.01516.72
7.2.300.0080.00816.65
7.2.290.0030.02116.36
7.2.260.0070.01014.83
7.2.250.0030.01515.22
7.2.240.0040.01115.18
7.2.230.0090.00615.33
7.2.220.0080.00814.80
7.2.210.0000.01615.02
7.2.200.0030.00615.01
7.2.190.0070.00414.90
7.2.180.0000.01315.03
7.2.170.0060.00815.17
7.2.160.0030.00915.23
7.2.150.0080.00817.07
7.2.140.0050.00516.91
7.2.130.0080.00416.77
7.2.120.0100.00317.03
7.2.110.0100.00716.94
7.2.100.0140.00016.97
7.2.90.0100.00316.83
7.2.80.0060.00617.00
7.2.70.0150.00016.59
7.2.60.0030.00616.95
7.2.50.0100.00616.75
7.2.40.0130.00016.57
7.2.30.0030.01016.82
7.2.20.0030.01516.83
7.2.10.0030.01516.93
7.2.00.0050.01017.99
7.1.330.0110.00415.89
7.1.320.0040.00715.95
7.1.310.0060.01215.95
7.1.300.0090.00615.54
7.1.290.0040.01115.99
7.1.280.0100.00315.77
7.1.270.0050.00515.80
7.1.260.0060.00615.46
7.1.250.0030.01015.70
7.1.240.0070.00715.82
7.1.230.0000.01415.89
7.1.220.0080.00415.77
7.1.210.0000.01315.85
7.1.200.0070.00815.76
7.1.190.0070.00315.76
7.1.180.0060.00315.61
7.1.170.0060.01015.75
7.1.160.0060.00615.95
7.1.150.0130.00015.82
7.1.140.0090.00615.64
7.1.130.0090.00615.78
7.1.120.0100.00015.86
7.1.110.0040.01115.68
7.1.100.0060.00617.09
7.1.90.0070.00715.66
7.1.80.0030.01215.86
7.1.70.0030.00616.48
7.1.60.0070.01017.67
7.1.50.0080.01125.17
7.1.40.0070.00715.92
7.1.30.0030.00615.75
7.1.20.0080.00815.62
7.1.10.0030.01015.91
7.1.00.0020.04319.07
7.0.330.0000.00915.23
7.0.320.0000.00915.44
7.0.310.0060.00615.45
7.0.300.0160.00015.35
7.0.290.0030.00615.15
7.0.280.0030.01015.28
7.0.270.0080.00815.18
7.0.260.0090.00315.36
7.0.250.0060.00915.40
7.0.240.0030.00915.64
7.0.230.0090.00615.38
7.0.220.0000.01115.66
7.0.210.0060.00815.55
7.0.200.0080.00215.83
7.0.190.0030.00915.48
7.0.180.0040.00415.50
7.0.170.0000.01315.47
7.0.160.0070.01015.23
7.0.150.0070.00415.53
7.0.140.0030.04218.71
7.0.130.0040.01115.40
7.0.120.0060.00315.52
7.0.110.0080.00515.18
7.0.100.0070.00715.36
7.0.90.0040.01115.49
7.0.80.0070.00715.53
7.0.70.0040.04718.63
7.0.60.0050.02318.59
7.0.50.0060.04118.78
7.0.40.0000.02116.78
7.0.30.0070.04116.83
7.0.20.0100.04216.78
7.0.10.0000.03916.71
7.0.00.0050.03516.84
5.6.400.0100.00314.39
5.6.390.0090.00314.44
5.6.380.0030.00614.79
5.6.370.0090.00614.38
5.6.360.0100.00614.09
5.6.350.0120.00014.61
5.6.340.0030.01414.49
5.6.330.0030.01314.03
5.6.320.0030.00914.79
5.6.310.0080.00414.70
5.6.300.0060.00314.47
5.6.290.0080.00314.79
5.6.280.0070.03817.63
5.6.270.0000.00914.57
5.6.260.0060.00614.61
5.6.250.0060.00614.49
5.6.240.0080.00014.24
5.6.230.0140.00014.47
5.6.220.0100.03017.58
5.6.210.0030.02317.46
5.6.200.0050.02317.74
5.6.190.0020.03017.75
5.6.180.0020.02417.64
5.6.170.0030.04017.67
5.6.160.0090.03517.74
5.6.150.0000.05017.74
5.6.140.0080.04517.85
5.6.130.0050.04617.81
5.6.120.0020.02517.83
5.6.110.0070.02217.70
5.6.100.0030.02517.71
5.6.90.0080.03217.80
5.6.80.0040.04117.40
5.6.70.0020.02917.33
5.6.60.0060.02317.35
5.6.50.0060.02917.56
5.6.40.0050.02017.48
5.6.30.0080.03517.46
5.6.20.0080.02717.33
5.6.10.0050.04417.33
5.6.00.0050.02817.31
5.5.380.0000.01714.42
5.5.370.0030.01014.25
5.5.360.0050.02417.38
5.5.350.0030.03517.51
5.5.340.0050.03517.59
5.5.330.0050.02717.69
5.5.320.0140.03317.57
5.5.310.0120.03517.76
5.5.300.0090.04117.50
5.5.290.0020.03717.72
5.5.280.0080.03017.57
5.5.270.0100.03717.72
5.5.260.0040.02417.66
5.5.250.0020.02717.51
5.5.240.0030.02517.21
5.5.230.0030.02317.25
5.5.220.0030.04017.14
5.5.210.0090.02917.25
5.5.200.0030.04517.14
5.5.190.0060.04117.29
5.5.180.0020.04317.35
5.5.170.0070.01014.28
5.5.160.0060.03317.22
5.5.150.0030.04117.30
5.5.140.0050.04317.40
5.5.130.0030.04817.41
5.5.120.0100.03717.24
5.5.110.0020.04517.34
5.5.100.0050.04117.13
5.5.90.0040.04017.15
5.5.80.0050.04017.00
5.5.70.0050.04317.25
5.5.60.0060.04317.29
5.5.50.0100.03917.38
5.5.40.0080.03516.98
5.5.30.0030.03417.26
5.5.20.0050.03017.20
5.5.10.0070.03717.02
5.5.00.0120.03517.24
5.4.450.0030.03715.25
5.4.440.0060.02015.46
5.4.430.0000.02415.17
5.4.420.0020.03815.20
5.4.410.0020.02715.35
5.4.400.0020.04215.21
5.4.390.0040.01814.99
5.4.380.0030.04015.24
5.4.370.0030.03015.08
5.4.360.0030.02315.01
5.4.350.0030.03815.26
5.4.340.0030.04515.17
5.4.330.0000.01211.30
5.4.320.0020.03515.12
5.4.310.0020.04315.13
5.4.300.0030.03515.26
5.4.290.0060.03815.09
5.4.280.0070.03315.06
5.4.270.0030.04015.12
5.4.260.0080.03815.16
5.4.250.0050.03714.86
5.4.240.0100.03415.16
5.4.230.0060.03514.90
5.4.220.0050.03715.15
5.4.210.0050.04015.17
5.4.200.0050.03514.96
5.4.190.0050.03815.08
5.4.180.0050.04015.15
5.4.170.0050.03715.06
5.4.160.0020.04115.12
5.4.150.0020.02315.09
5.4.140.0000.03913.89
5.4.130.0030.02313.74
5.4.120.0060.02513.74
5.4.110.0050.03813.74
5.4.100.0030.02113.80
5.4.90.0030.04013.80
5.4.80.0040.01913.74
5.4.70.0060.02813.80
5.4.60.0050.04213.81
5.4.50.0020.02413.85
5.4.40.0050.03713.75
5.4.30.0050.01613.74
5.4.20.0060.03513.78
5.4.10.0080.02813.79
5.4.00.0010.02313.22
5.3.290.0050.03112.75
5.3.280.0060.03112.64
5.3.270.0030.04012.66
5.3.260.0020.03512.61
5.3.250.0050.02212.58
5.3.240.0060.02312.56
5.3.230.0020.04012.62
5.3.220.0020.03312.56
5.3.210.0030.03512.46
5.3.200.0020.02712.49
5.3.190.0040.03912.56
5.3.180.0020.03212.65
5.3.170.0030.03212.50
5.3.160.0050.02212.58
5.3.150.0030.04012.60
5.3.140.0080.03512.61
5.3.130.0030.03212.48
5.3.120.0020.03812.59
5.3.110.0040.01912.59
5.3.100.0050.03612.28
5.3.90.0030.03312.25
5.3.80.0020.02312.22
5.3.70.0030.03812.13
5.3.60.0020.02312.37
5.3.50.0040.03712.20
5.3.40.0050.03312.04
5.3.30.0020.03912.08
5.3.20.0050.03712.04
5.3.10.0000.03411.87
5.3.00.0020.03612.13
5.2.170.0070.05711.34
5.2.160.0030.06011.34
5.2.150.0030.06011.34
5.2.140.0070.05711.34
5.2.130.0000.06311.34
5.2.120.0070.06011.34
5.2.110.0030.06011.34
5.2.100.0030.05311.34
5.2.90.0000.06011.34
5.2.80.0000.06311.34
5.2.70.0000.06311.34
5.2.60.0030.06311.34
5.2.50.0070.05311.34
5.2.40.0070.05711.34
5.2.30.0000.05711.34
5.2.20.0000.06311.34
5.2.10.0000.06011.34
5.2.00.0000.06311.34
5.1.60.0030.05011.34
5.1.50.0000.05711.34
5.1.40.0030.05011.34
5.1.30.0000.05711.34
5.1.20.0000.05311.34
5.1.10.0000.05711.34
5.1.00.0030.04311.34
5.0.50.0100.03311.34
5.0.40.0000.03011.34
5.0.30.0000.06711.34
5.0.20.0070.03711.34
5.0.10.0070.04011.34
5.0.00.0070.06311.34
4.4.90.0000.03711.34
4.4.80.0030.03311.34
4.4.70.0000.03711.34
4.4.60.0000.03311.34
4.4.50.0030.03711.34
4.4.40.0030.04011.34
4.4.30.0000.03311.34
4.4.20.0000.03311.34
4.4.10.0030.03711.34
4.4.00.0030.04311.34
4.3.110.0000.03711.34
4.3.100.0030.03011.34
4.3.90.0030.03011.34
4.3.80.0000.04311.34
4.3.70.0000.03011.34
4.3.60.0000.03311.34
4.3.50.0030.03011.34
4.3.40.0000.04711.34
4.3.30.0070.03011.34
4.3.20.0000.03711.34
4.3.10.0000.03311.34
4.3.00.0030.03011.34

preferences:
49.23 ms | 401 KiB | 5 Q