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))); 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.40.0090.00618.55
8.3.30.0090.00919.09
8.3.20.0040.00420.05
8.3.10.0080.00021.95
8.3.00.0060.00322.52
8.2.170.0070.00722.96
8.2.160.0060.01121.00
8.2.150.0040.00424.18
8.2.140.0140.00024.66
8.2.130.0030.00626.16
8.2.120.0040.00417.50
8.2.110.0040.00422.25
8.2.100.0040.00817.78
8.2.90.0060.00319.08
8.2.80.0000.00917.97
8.2.70.0000.00917.50
8.2.60.0030.00517.90
8.2.50.0000.00818.07
8.2.40.0050.00318.03
8.2.30.0040.00417.92
8.2.20.0000.00817.57
8.2.10.0080.00019.46
8.2.00.0000.00717.62
8.1.270.0020.00523.99
8.1.260.0060.00326.35
8.1.250.0070.00428.09
8.1.240.0070.01023.84
8.1.230.0040.00719.10
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0070.00017.53
8.1.180.0000.00818.10
8.1.170.0040.00418.51
8.1.160.0000.00821.91
8.1.150.0040.00418.52
8.1.140.0000.00717.39
8.1.130.0070.00017.80
8.1.120.0000.00717.45
8.1.110.0000.00817.43
8.1.100.0000.00817.32
8.1.90.0000.00717.39
8.1.80.0000.00717.45
8.1.70.0000.00817.40
8.1.60.0040.00417.44
8.1.50.0040.00417.52
8.1.40.0040.00417.49
8.1.30.0040.00417.57
8.1.20.0030.00517.72
8.1.10.0000.00717.63
8.1.00.0000.00817.50
8.0.300.0000.00718.77
8.0.290.0000.00717.05
8.0.280.0050.00218.31
8.0.270.0000.00717.20
8.0.260.0060.00016.80
8.0.250.0030.00316.84
8.0.240.0000.00816.94
8.0.230.0000.00716.98
8.0.220.0040.00316.86
8.0.210.0050.00216.86
8.0.200.0030.00316.85
8.0.190.0000.00716.98
8.0.180.0050.00216.96
8.0.170.0060.00316.81
8.0.160.0000.00816.87
8.0.150.0000.00816.77
8.0.140.0000.00716.89
8.0.130.0030.00313.36
8.0.120.0000.00716.89
8.0.110.0000.00716.71
8.0.100.0040.00416.79
8.0.90.0040.00416.81
8.0.80.0120.00316.87
8.0.70.0000.00716.85
8.0.60.0040.00416.84
8.0.50.0080.00016.89
8.0.30.0130.00917.02
8.0.20.0070.01217.40
8.0.10.0070.00017.14
8.0.00.0110.01016.57
7.4.330.0060.00015.00
7.4.320.0000.00616.38
7.4.300.0030.00316.44
7.4.290.0050.00216.46
7.4.280.0030.00316.41
7.4.270.0000.00716.46
7.4.260.0030.00316.51
7.4.250.0040.00416.42
7.4.240.0040.00316.37
7.4.230.0030.00316.34
7.4.220.0060.01216.65
7.4.210.0050.01216.58
7.4.200.0050.00316.59
7.4.190.0040.00416.65
7.4.160.0060.00916.31
7.4.150.0150.00817.40
7.4.140.0090.00917.86
7.4.130.0080.00816.46
7.4.120.0100.00716.47
7.4.110.0160.00016.48
7.4.100.0030.01516.26
7.4.90.0140.00416.49
7.4.80.0100.01316.55
7.4.70.0150.00316.27
7.4.60.0070.01016.46
7.4.50.0050.00316.30
7.4.40.0030.01322.77
7.4.30.0060.01016.32
7.4.00.0050.01214.85
7.3.330.0000.00513.02
7.3.320.0000.00513.24
7.3.310.0040.00416.27
7.3.300.0030.00316.11
7.3.290.0040.01416.21
7.3.280.0050.01116.23
7.3.270.0030.01317.40
7.3.260.0070.01116.28
7.3.250.0070.01316.33
7.3.240.0090.01216.12
7.3.230.0100.00616.39
7.3.210.0130.00316.41
7.3.200.0050.01619.39
7.3.190.0130.01016.41
7.3.180.0140.00416.34
7.3.170.0150.00016.27
7.3.160.0040.01316.24
7.3.120.0070.01014.76
7.3.110.0110.00614.57
7.3.100.0070.00714.72
7.3.90.0030.00614.33
7.3.80.0080.00614.73
7.3.70.0000.01014.60
7.3.60.0030.01314.41
7.3.50.0000.00914.75
7.3.40.0090.00614.78
7.3.30.0000.01114.42
7.3.20.0050.00516.45
7.3.10.0050.00716.41
7.3.00.0070.00516.40
7.2.330.0070.01016.52
7.2.320.0140.00316.68
7.2.310.0080.00816.56
7.2.300.0110.00716.63
7.2.290.0080.00816.56
7.2.250.0000.01815.02
7.2.240.0030.01715.18
7.2.230.0120.00314.89
7.2.220.0030.01014.75
7.2.210.0000.01414.82
7.2.200.0040.01114.71
7.2.190.0040.00714.92
7.2.180.0030.00814.70
7.2.170.0080.00614.96
7.2.130.0030.01016.47
7.2.120.0090.00616.46
7.2.110.0030.01016.68
7.2.100.0070.00416.90
7.2.90.0070.00316.52
7.2.80.0090.00616.52
7.2.70.0070.01116.81
7.2.60.0120.00716.68
7.2.50.0140.00616.59
7.2.40.0130.00716.70
7.2.30.0130.01016.74
7.2.20.0080.00816.44
7.2.10.0060.00616.96
7.2.00.0050.00816.81
7.1.330.0040.01115.87
7.1.320.0040.01115.47
7.1.310.0000.01115.61
7.1.300.0070.01015.66
7.1.290.0090.00315.54
7.1.280.0030.01015.46
7.1.270.0100.00315.70
7.1.260.0030.00715.64
7.1.250.0040.01115.51
7.1.200.0000.01315.75
7.1.100.0050.00517.68
7.1.70.0030.00516.93
7.1.60.0100.01319.82
7.1.50.0030.00716.75
7.1.00.0030.07722.45
7.0.200.0090.00616.65
7.0.140.0000.07722.17
7.0.60.0000.04319.90
7.0.50.0030.08717.86
7.0.40.0130.08320.02
7.0.30.0300.03720.28
7.0.20.0300.07020.08
7.0.10.0230.07020.22
7.0.00.0070.08020.23
5.6.280.0100.07021.03
5.6.210.0030.09020.72
5.6.200.0030.04318.29
5.6.190.0130.08020.77
5.6.180.2930.03320.52
5.6.170.0370.05020.39
5.6.160.0070.08320.55
5.6.150.0100.05018.15
5.6.140.0000.08718.27
5.6.130.0070.04018.28
5.6.120.0000.04721.14
5.6.110.0070.04021.00
5.6.100.0030.09021.11
5.6.90.0070.03720.98
5.6.80.0200.06320.39
5.5.350.0000.08320.35
5.5.340.0100.07717.90
5.5.330.0130.07320.31
5.5.320.0270.05020.38
5.5.310.0200.08320.34
5.5.300.0070.06317.95
5.5.290.0100.08018.04
5.5.280.0130.06720.88
5.5.270.0100.07320.86
5.5.260.0200.06320.87
5.5.250.0130.08020.69
5.5.240.0070.05320.07
5.4.450.0130.04319.48
5.4.440.0470.08019.49
5.4.430.0400.03719.40
5.4.420.0270.03719.21
5.4.410.0030.08318.69
5.4.400.0070.05318.62
5.4.390.0130.05318.70
5.4.380.0200.05018.58
5.4.370.0300.05318.78
5.4.360.0270.05018.50
5.4.350.0270.05318.70
5.4.340.0300.04718.75
5.4.320.0060.04012.50
5.4.310.0060.04612.50
5.4.300.0070.03712.50
5.4.290.0090.04112.50
5.4.280.0020.03912.39
5.4.270.0090.03212.39
5.4.260.0060.03612.39
5.4.250.0070.03612.40
5.4.240.0050.04912.39
5.4.230.0080.04412.38
5.4.220.0080.04012.39
5.4.210.0030.03712.39
5.4.200.0070.04212.38
5.4.190.0140.04512.38
5.4.180.0120.04512.38
5.4.170.0100.04812.39
5.4.160.0150.04312.38
5.4.150.0120.04812.38
5.4.140.0200.04112.06
5.4.130.0240.09412.05
5.4.120.0170.03912.01
5.4.110.0200.03712.00
5.4.100.0110.04612.00
5.4.90.0130.04512.00
5.4.80.0170.07512.01
5.4.70.0200.04612.00
5.4.60.0280.09112.00
5.4.50.0170.04012.00
5.4.40.0190.06811.99
5.4.30.0170.04111.98
5.4.20.0180.03811.98
5.4.10.0200.03611.99
5.4.00.0360.08111.48
5.3.290.0100.05212.80
5.3.280.0050.03912.71
5.3.270.0190.04312.72
5.3.260.0240.03912.72
5.3.250.0180.04612.72
5.3.240.0370.08712.72
5.3.230.0160.04612.71
5.3.220.0190.04312.68
5.3.210.0240.09912.68
5.3.200.0130.04812.68
5.3.190.0190.04212.68
5.3.180.0190.07012.67
5.3.170.0160.04312.67
5.3.160.0150.04412.67
5.3.150.0170.04212.67
5.3.140.0150.04412.66
5.3.130.0300.09012.66
5.3.120.0160.04412.66
5.3.110.0110.04812.66
5.3.100.0210.03912.12
5.3.90.0180.04012.11
5.3.80.0180.04112.10
5.3.70.0200.03912.10
5.3.60.0350.08912.08
5.3.50.0130.04612.02
5.3.40.0130.04812.03
5.3.30.0160.04311.99
5.3.20.0140.04511.77
5.3.10.0180.03811.74
5.3.00.0120.04611.72
5.2.170.0200.0589.21
5.2.160.0170.0339.22
5.2.150.0150.0379.22
5.2.140.0130.0699.21
5.2.130.0080.0389.18
5.2.120.0150.0389.18
5.2.110.0140.0389.18
5.2.100.0130.0389.18
5.2.90.0190.0589.18
5.2.80.0120.0379.17
5.2.70.0170.0329.18
5.2.60.0240.0579.13
5.2.50.0170.0459.10
5.2.40.0140.0379.08
5.2.30.0330.0519.05
5.2.20.0150.0409.04
5.2.10.0130.0378.95
5.2.00.0160.0318.79
5.1.60.0110.0338.09
5.1.50.0140.0328.08
5.1.40.0110.0308.06
5.1.30.0140.0338.41
5.1.20.0280.1108.44
5.1.10.0120.0348.16
5.1.00.0190.0288.16
5.0.50.0120.0256.64
5.0.40.0090.0266.50
5.0.30.0230.0856.31
5.0.20.0120.0256.28
5.0.10.0110.0276.26
5.0.00.0100.0396.25
4.4.90.0090.0174.78
4.4.80.0050.0234.75
4.4.70.0060.0204.76
4.4.60.0060.0194.75
4.4.50.0090.0164.77
4.4.40.0060.0304.71
4.4.30.0060.0224.76
4.4.20.0060.0204.84
4.4.10.0080.0174.84
4.4.00.0070.0304.75
4.3.110.0090.0174.67
4.3.100.0050.0214.66
4.3.90.0080.0184.63
4.3.80.0060.0304.58
4.3.70.0100.0184.63
4.3.60.0090.0194.63
4.3.50.0250.0334.63
4.3.40.0070.0284.54
4.3.30.0030.0223.30
4.3.20.0070.0183.29
4.3.10.0110.0183.25
4.3.00.0130.01313.03

preferences:
42.36 ms | 400 KiB | 5 Q