3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $test1 = 'hello'; protected $test2 = 'world'; protected $test3; public function toArray() { $this->test1 = null; $this->test3 = false; $array = get_object_vars($this); return array_filter($array, 'strlen'); } } $a = new A(); print_r(array_filter(array(1,2,false,null), array($this, 'strlen'))); exit(); print_r($a->toArray());

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.0040.01416.37
8.3.50.0130.00816.42
8.3.40.0090.00918.88
8.3.30.0070.00718.79
8.3.20.0080.00018.77
8.3.10.0080.00018.70
8.3.00.0030.00619.38
8.2.180.0140.00716.75
8.2.170.0150.00322.96
8.2.160.0040.01218.79
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.01126.16
8.2.120.0070.01120.69
8.2.110.0040.00422.20
8.2.100.0140.00017.84
8.2.90.0000.00817.75
8.2.80.0000.00817.97
8.2.70.0000.00818.04
8.2.60.0040.00417.80
8.2.50.0040.00418.10
8.2.40.0060.00321.02
8.2.30.0000.00819.06
8.2.20.0090.00017.67
8.2.10.0020.00517.73
8.2.00.0030.00517.61
8.1.280.0040.01825.92
8.1.270.0070.00023.99
8.1.260.0120.00626.35
8.1.250.0000.00828.09
8.1.240.0060.00323.89
8.1.230.0070.00318.97
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0000.00917.23
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0030.00518.81
8.1.160.0070.00018.82
8.1.150.0000.00718.46
8.1.140.0040.00417.43
8.1.130.0000.00717.31
8.1.120.0030.00517.37
8.1.110.0050.00317.41
8.1.100.0040.00317.38
8.1.90.0080.00017.45
8.1.80.0040.00417.31
8.1.70.0000.00717.30
8.1.60.0100.00017.53
8.1.50.0040.00417.45
8.1.40.0080.00017.54
8.1.30.0000.00817.61
8.1.20.0040.00417.57
8.1.10.0040.00417.59
8.1.00.0040.00417.54
8.0.300.0030.00618.77
8.0.290.0000.00816.63
8.0.280.0000.00718.46
8.0.270.0040.00417.20
8.0.260.0000.00616.81
8.0.250.0040.00416.85
8.0.240.0040.00416.84
8.0.230.0080.00016.87
8.0.220.0000.00716.92
8.0.210.0000.00616.86
8.0.200.0000.00716.98
8.0.190.0070.00017.00
8.0.180.0060.00316.90
8.0.170.0040.00416.80
8.0.160.0000.00716.79
8.0.150.0000.00816.93
8.0.140.0050.00316.86
8.0.130.0000.00513.37
8.0.120.0000.01016.79
8.0.110.0000.00716.93
8.0.100.0040.00416.75
8.0.90.0040.00416.86
8.0.80.0060.01116.91
8.0.70.0050.00316.89
8.0.60.0040.00416.83
8.0.50.0030.00616.85
8.0.30.0060.01216.93
8.0.20.0100.00816.97
8.0.10.0040.00416.91
8.0.00.0090.00916.88
7.4.330.0060.00012.93
7.4.320.0000.00716.35
7.4.300.0000.00716.51
7.4.290.0080.00016.63
7.4.280.0080.00016.50
7.4.270.0070.00016.58
7.4.260.0030.00313.21
7.4.250.0040.00416.49
7.4.240.0040.00416.50
7.4.230.0030.00716.69
7.4.220.0090.01316.38
7.4.210.0000.01416.54
7.4.200.0060.00316.52
7.4.190.0040.00416.52
7.4.160.0100.00716.45
7.4.150.0150.00416.57
7.4.140.0030.01616.52
7.4.130.0080.00816.60
7.4.120.0060.01016.61
7.4.110.0140.02616.73
7.4.100.0100.01016.36
7.4.90.0120.00916.59
7.4.80.0120.00919.39
7.4.70.0000.01616.43
7.4.60.0110.00716.58
7.4.50.0060.00016.59
7.4.40.0030.01216.25
7.4.30.0100.00716.49
7.4.00.0000.01415.15
7.3.330.0000.00613.08
7.3.320.0030.00313.15
7.3.310.0060.00016.26
7.3.300.0000.00716.16
7.3.290.0100.00316.31
7.3.280.0090.00916.34
7.3.270.0110.01116.39
7.3.260.0090.01016.52
7.3.250.0100.01016.56
7.3.240.0080.00816.52
7.3.230.0070.01016.22
7.3.210.0060.00916.18
7.3.200.0130.00316.39
7.3.190.0140.00516.33
7.3.180.0110.00416.52
7.3.170.0090.00616.45
7.3.160.0030.01316.48
7.3.120.0040.01114.76
7.3.10.0100.00716.46
7.3.00.0070.01016.45
7.2.330.0070.01016.36
7.2.320.0070.01116.54
7.2.310.0100.00716.70
7.2.300.0100.00716.56
7.2.290.0090.00916.63
7.2.130.0120.00916.57
7.2.120.0060.00916.37
7.2.110.0180.01216.46
7.2.100.0200.00316.31
7.2.90.0090.00616.13
7.2.80.0120.00916.41
7.2.70.0120.00316.50
7.2.60.0860.00815.88
7.2.50.0150.00416.50
7.2.40.0030.01016.54
7.2.30.0070.01416.28
7.2.20.0200.00816.75
7.2.10.0120.00616.54
7.2.00.0100.00617.96
7.1.250.0160.00615.33
7.1.200.0040.00715.62
7.1.100.0080.00318.08
7.1.70.0040.00417.21
7.1.60.0170.00719.30
7.1.50.0030.01716.64
7.1.00.0000.08022.40
7.0.200.0000.00716.42
7.0.140.0030.07321.97
7.0.120.0070.07022.02
7.0.60.0000.08319.91
7.0.50.0100.04017.91
7.0.40.0070.04720.27
7.0.30.0270.05720.16
7.0.20.0300.07020.26
7.0.10.0100.05020.33
7.0.00.0070.08020.09
5.6.280.0100.06721.09
5.6.210.0070.08020.75
5.6.200.0100.04718.29
5.6.190.0030.09020.64
5.6.180.0230.05720.65
5.6.170.0200.05320.54
5.6.160.0030.06020.48
5.6.150.0030.03718.25
5.6.140.0070.08718.18
5.6.130.0170.07318.18
5.6.120.0070.06021.04
5.6.110.0030.07320.99
5.6.100.0100.05320.99
5.6.90.0070.08321.10
5.6.80.0170.06320.44
5.5.350.0030.07720.34
5.5.340.0070.05318.07
5.5.330.0030.04020.28
5.5.320.0200.04320.30
5.5.310.0230.08020.55
5.5.300.0100.07017.98
5.5.290.0070.08018.02
5.5.280.0100.04020.78
5.5.270.0130.08020.84
5.5.260.0170.07720.79
5.5.250.0130.08320.70
5.5.240.0230.04020.26
5.4.450.0200.06019.50
5.4.440.0200.04319.30
5.4.430.0300.06719.32
5.4.420.0270.07019.30
5.4.410.0230.07319.41
5.4.400.0230.04319.23
5.4.390.0230.07018.98
5.4.380.0070.06719.06
5.4.370.0300.03718.87
5.4.360.0270.04719.13
5.4.350.0130.05719.08
5.4.340.0230.07719.13
5.4.320.0200.04019.18
5.4.310.0270.06319.05
5.4.300.0200.07019.19
5.4.290.0270.05319.08
5.4.280.0200.07718.87
5.4.270.0230.07318.88
5.4.260.0170.04019.08
5.4.250.0200.05019.23
5.4.240.0270.06718.98
5.4.230.0100.06019.15
5.4.220.0270.07718.98
5.4.210.0330.06319.21
5.4.200.0330.06019.08
5.4.190.0170.06318.98
5.4.180.0130.04318.97
5.4.170.0200.06318.93
5.4.160.0170.05319.24
5.4.150.0200.03319.11
5.4.140.0230.07016.30
5.4.130.0200.04316.34
5.4.120.0200.04016.37
5.4.110.0270.07016.58
5.4.100.0130.04316.20
5.4.90.0230.06716.58
5.4.80.0200.07316.33
5.4.70.0270.02316.52
5.4.60.0200.03716.34
5.4.50.0270.05316.52
5.4.40.0230.04016.53
5.4.30.0270.05316.52
5.4.20.0270.06016.52
5.4.10.0200.04016.16
5.4.00.0200.07315.77
5.3.290.0200.05014.66
5.3.280.0230.07014.68
5.3.270.0170.04714.52
5.3.260.0200.04714.65
5.3.250.0170.04314.57
5.3.240.0230.07014.52
5.3.230.0200.04314.71
5.3.220.0130.04714.48
5.3.210.0170.04314.62
5.3.200.0170.04314.46
5.3.190.0100.06714.53
5.3.180.0200.04314.56
5.3.170.0170.04014.55
5.3.160.0130.04714.71
5.3.150.0200.06314.68
5.3.140.0230.03714.77
5.3.130.0230.03714.59
5.3.120.0200.07314.66
5.3.110.0270.06014.44
5.3.100.0330.06014.15
5.3.90.0100.07013.95
5.3.80.0030.06314.03
5.3.70.0100.07014.09
5.3.60.0170.06014.09
5.3.50.0000.04013.96
5.3.40.0130.03714.03
5.3.30.0070.05714.06
5.3.20.0070.05713.76
5.3.10.0000.07313.76
5.3.00.0000.07013.76
5.2.170.0030.05013.76
5.2.160.0030.05013.76
5.2.150.0030.06013.76
5.2.140.0030.06713.76
5.2.130.0000.06013.76
5.2.120.0070.04313.76
5.2.110.0000.03713.76
5.2.100.0000.03313.76
5.2.90.0070.02313.76
5.2.80.0000.03013.76
5.2.70.0070.05713.76
5.2.60.0030.04013.76
5.2.50.0000.06013.76
5.2.40.0100.04713.76
5.2.30.0000.04313.76
5.2.20.0030.05313.76
5.2.10.0030.03713.76
5.2.00.0070.06013.76
5.1.60.0030.05013.76
5.1.50.0000.04013.76
5.1.40.0070.04013.76
5.1.30.0000.03313.76
5.1.20.0070.04313.76
5.1.10.0070.02313.76
5.1.00.0000.05013.76
5.0.50.0000.03013.76
5.0.40.0030.02713.76
5.0.30.0000.03713.76
5.0.20.0030.02013.76
5.0.10.0030.03713.76
5.0.00.0000.05013.76
4.4.90.0030.02313.76
4.4.80.0070.02713.76
4.4.70.0000.02713.76
4.4.60.0000.03313.76
4.4.50.0100.01313.76
4.4.40.0000.03313.76
4.4.30.0000.02313.76
4.4.20.0000.02713.76
4.4.10.0000.02013.76
4.4.00.0030.03013.76
4.3.110.0030.01313.76
4.3.100.0000.01713.76
4.3.90.0000.01713.76
4.3.80.0030.05013.76
4.3.70.0000.03313.76
4.3.60.0070.02313.76
4.3.50.0070.01313.76
4.3.40.0000.05313.76
4.3.30.0000.03313.76
4.3.20.0000.03013.76
4.3.10.0000.02713.76
4.3.00.0030.02313.76

preferences:
40.57 ms | 401 KiB | 5 Q