3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $a; protected $b; public $c; } class FooCountable implements \Countable { private $elements = [1,2,3]; public function count() { return count($this->elements); } } $tests = [ 'array' => [1,2,3], 'string' => 'hello world', 'number' => 123, 'iterator' => new \ArrayIterator([1,2,3]), 'countable' => new \FooCountable(), 'zero' => 0, 'string_zero' => '0', 'object' => new \Foo(), 'stdClass' => new \stdClass, 'null' => null, 'empty' => '', 'boolt' => true, 'boolf' => false ]; foreach($tests as $key => $test) { echo $key . ': ' . print_r(@count($test), 1) . \PHP_EOL; } echo '---' . \PHP_EOL; echo 'Undefined: ' . @count($undefinedVariable);

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.70.0060.00916.63
8.3.60.0040.01118.54
8.3.50.0110.00418.18
8.3.40.0160.00318.79
8.3.30.0030.01218.53
8.3.20.0000.00818.95
8.3.10.0040.00421.70
8.3.00.0000.00821.90
8.2.190.0140.00416.85
8.2.180.0110.00425.92
8.2.170.0150.00319.04
8.2.160.0070.00722.96
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0080.00020.78
8.2.110.0030.00721.04
8.2.100.0040.00817.97
8.2.90.0030.00618.34
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0080.00018.04
8.2.50.0040.00418.07
8.2.40.0030.00618.35
8.2.30.0060.00318.14
8.2.20.0080.00018.06
8.2.10.0000.00818.06
8.2.00.0080.00018.21
8.1.280.0110.00425.92
8.1.270.0080.00020.36
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.00922.05
8.1.230.0040.00822.62
8.1.220.0080.00017.76
8.1.210.0050.00318.79
8.1.200.0000.01017.35
8.1.190.0000.00817.35
8.1.180.0080.00018.10
8.1.170.0040.00418.89
8.1.160.0040.00418.91
8.1.150.0000.00818.87
8.1.140.0040.00418.83
8.1.130.0000.00717.44
8.1.120.0040.00417.53
8.1.110.0040.00417.52
8.1.100.0030.00517.48
8.1.90.0080.00017.45
8.1.80.0060.00317.46
8.1.70.0030.00317.44
8.1.60.0040.00417.48
8.1.50.0090.00017.55
8.1.40.0080.00017.55
8.1.30.0000.00817.53
8.1.20.0040.00417.57
8.1.10.0040.00417.61
8.1.00.0040.00417.46
8.0.300.0070.00019.90
8.0.290.0000.00816.75
8.0.280.0000.00718.41
8.0.270.0070.00016.83
8.0.260.0030.00316.84
8.0.250.0070.00017.04
8.0.240.0000.00716.93
8.0.230.0000.00717.04
8.0.220.0030.00416.83
8.0.210.0000.00716.95
8.0.200.0000.00717.06
8.0.190.0040.00417.08
8.0.180.0030.00516.89
8.0.170.0040.00817.02
8.0.160.0030.00516.96
8.0.150.0060.00616.84
8.0.140.0040.00416.95
8.0.130.0000.00513.47
8.0.120.0040.00416.79
8.0.110.0030.00516.92
8.0.100.0040.00417.04
8.0.90.0040.00416.82
8.0.80.0090.00916.93
8.0.70.0030.00517.02
8.0.60.0000.00716.87
8.0.50.0000.00716.87
8.0.30.0090.01017.17
8.0.20.0130.00717.40
8.0.10.0030.00517.22
8.0.00.0120.00616.94
7.4.330.0000.00615.55
7.4.320.0000.00616.65
7.4.300.0000.00616.64
7.4.290.0030.00316.52
7.4.280.0000.00916.60
7.4.270.0070.00016.54
7.4.260.0070.00016.50
7.4.250.0000.00916.51
7.4.240.0040.00416.63
7.4.230.0040.00316.69
7.4.220.0030.00616.65
7.4.210.0030.01116.65
7.4.200.0000.00716.63
7.4.160.0100.00716.55
7.4.140.0120.00817.86
7.4.130.0190.00016.45
7.4.120.0080.01016.62
7.4.110.0140.00516.64
7.4.100.0070.01116.54
7.4.90.0090.01316.60
7.4.80.0110.01119.39
7.4.70.0100.01016.77
7.4.60.0030.01416.48
7.4.50.0040.01216.75
7.4.40.0090.00916.70
7.4.00.0100.01015.01
7.3.330.0030.00313.37
7.3.320.0000.00513.39
7.3.310.0040.00416.42
7.3.300.0030.00316.38
7.3.290.0070.00016.25
7.3.280.0080.00816.34
7.3.260.0220.00916.36
7.3.240.0110.00816.42
7.3.230.0120.00416.39
7.3.210.0100.01316.50
7.3.200.0100.00616.55
7.3.190.0100.01016.37
7.3.180.0110.00516.63
7.3.170.0070.01016.42
7.3.160.0080.00816.32
7.3.120.0170.00714.83
7.3.110.0230.00014.76
7.3.100.0070.00714.83
7.3.90.0090.00014.66
7.3.80.0090.00614.96
7.3.70.0070.00714.89
7.3.60.0070.00714.63
7.3.50.0060.00914.62
7.3.40.0080.00414.56
7.3.30.0040.00914.62
7.3.20.0360.00515.65
7.3.10.0380.01115.71
7.3.00.0310.00515.58
7.2.330.0110.01116.48
7.2.320.0100.00616.78
7.2.310.0040.01316.52
7.2.300.0000.01516.40
7.2.290.0110.00616.60
7.2.250.0060.01714.66
7.2.240.0170.00715.16
7.2.230.0060.00315.16
7.2.220.0070.00715.06
7.2.210.0060.00614.76
7.2.200.0070.00715.05
7.2.190.0080.00415.01
7.2.180.0070.00714.87
7.2.170.0070.00315.02
7.2.160.0070.00414.68
7.2.150.0480.00615.18
7.2.140.0660.01214.81
7.2.130.0650.00515.26
7.2.120.0430.00914.90
7.2.110.0510.00814.77
7.2.100.1320.00414.75
7.2.90.1010.00414.86
7.2.80.1090.00914.71
7.2.70.1150.00514.71
7.2.60.0640.00915.06
7.2.50.0390.00414.95
7.2.40.0850.00914.95
7.2.30.0950.01015.16
7.2.20.1290.00815.00
7.2.10.0600.00614.99
7.2.00.1530.00914.92
7.1.330.0040.01115.78
7.1.320.0000.01215.58
7.1.310.0060.00615.57
7.1.300.0040.01115.54
7.1.290.0090.00615.50
7.1.280.0110.00015.73
7.1.270.0380.00914.84
7.1.260.0300.00814.80
7.1.250.0600.00313.84
7.1.240.0440.00513.68
7.1.230.0500.00513.73
7.1.220.1120.00813.81
7.1.210.1160.00313.83
7.1.200.2390.00613.97
7.1.190.1010.00913.66
7.1.180.0550.01213.85
7.1.170.0670.00613.93
7.1.160.1110.00813.88
7.1.150.1370.00613.73
7.1.140.1760.00813.75
7.1.130.0980.00913.79
7.1.120.1490.00313.97
7.1.110.0480.00714.01
7.1.100.1180.00613.91
7.1.90.1600.00513.66
7.1.80.1810.00413.82
7.1.70.1730.00513.70
7.1.60.1300.00819.54
7.1.50.2280.00619.77
7.1.40.2710.00819.72
7.1.30.2540.00819.73
7.1.20.2620.00619.78
7.1.10.2130.00713.74
7.1.00.0670.00413.79
7.0.330.0520.00713.60
7.0.320.0410.00813.54
7.0.310.0760.00613.57
7.0.300.0660.00713.46
7.0.290.0650.01313.58
7.0.280.0630.00913.57
7.0.270.0640.01113.43
7.0.260.0810.00413.50
7.0.250.0660.01113.41
7.0.240.0680.00613.27
7.0.230.0670.01013.61
7.0.220.0470.00613.43
7.0.210.0850.01013.57
7.0.200.0650.01213.70
7.0.190.0580.01113.49
7.0.180.0750.00713.54
7.0.170.0650.00713.23
7.0.160.0440.01813.55
7.0.150.0500.01213.49
7.0.140.0590.00313.52
7.0.130.0540.00613.36
7.0.120.0530.01713.72
7.0.110.0630.00313.62
7.0.100.0690.00613.37
7.0.90.0600.01313.51
7.0.80.0660.00313.55
7.0.70.0540.01013.50
7.0.60.0710.00313.27
7.0.50.0740.00313.78
7.0.40.0420.01513.73
7.0.30.0610.01013.38
7.0.20.0730.00313.48
7.0.10.0660.00713.52
7.0.00.0910.00713.74
5.6.400.0040.00714.22
5.6.390.0110.01114.20
5.6.380.0070.01014.33
5.6.370.0140.00314.11
5.6.360.0240.00613.79
5.6.350.0170.01214.14
5.6.340.0210.01114.17
5.6.330.0080.01014.19
5.6.320.0110.01114.50
5.6.310.0130.00314.38
5.6.300.0150.01514.06
5.6.290.0200.01114.14
5.6.280.0150.01314.27
5.6.270.0130.01014.21
5.6.260.0150.00414.57
5.6.250.0210.00914.17
5.6.240.0240.00414.39
5.6.230.0030.01914.27
5.6.220.0130.01314.46
5.6.210.0190.00614.01
5.6.200.0170.00414.39
5.6.190.0200.00014.30
5.6.180.0130.01514.42
5.6.170.0170.01014.38
5.6.160.0230.00014.15
5.6.150.0220.00014.36
5.6.140.0080.01514.20
5.6.130.0110.01414.07
5.6.120.0130.01314.36
5.6.110.0140.01414.34
5.6.100.0150.00614.20
5.6.90.0160.01314.38
5.6.80.0110.00414.09
5.6.70.0180.00314.25
5.6.60.0170.01014.11
5.6.50.0110.01514.30
5.6.40.0190.00013.95
5.6.30.0070.01014.35
5.6.20.0230.00714.26
5.6.10.0090.01514.35
5.6.00.0150.01013.94
5.5.380.0190.00514.05
5.5.370.0150.01414.20
5.5.360.0140.01114.08
5.5.350.0170.01414.37
5.5.340.0070.01114.16
5.5.330.0210.01214.27
5.5.320.0130.01314.16
5.5.310.0140.01813.80
5.5.300.0140.01614.34
5.5.290.0110.00414.00
5.5.280.0250.00414.11
5.5.270.0140.01814.28
5.5.260.0200.00614.39
5.5.250.0120.01713.91
5.5.240.0240.00314.13
5.5.230.0160.00314.17
5.5.220.0200.00414.35
5.5.210.0250.00413.97
5.5.200.0200.01014.04
5.5.190.0040.01514.20
5.5.180.0080.00814.03
5.5.170.0190.01213.99
5.5.160.0110.00814.07
5.5.150.0240.00713.86
5.5.140.0150.01614.30
5.5.130.0140.00614.34
5.5.120.0120.00414.42
5.5.110.0170.00314.24
5.5.100.0130.01614.00
5.5.90.0080.01914.28
5.5.80.0090.00614.34
5.5.70.0050.01313.79
5.5.60.0200.00513.95
5.5.50.0210.00313.99
5.5.40.0130.01314.20
5.5.30.0150.00813.91
5.5.20.0120.01214.04
5.5.10.0110.00913.85
5.5.00.0020.01714.29
5.4.450.0080.00811.83
5.4.440.0170.00011.83
5.4.430.0110.01111.83
5.4.420.0150.00511.83
5.4.410.0130.00011.83
5.4.400.0210.00011.83
5.4.390.0200.00311.83
5.4.380.0110.00411.83
5.4.370.0150.00311.83
5.4.360.0050.00511.83
5.4.350.0070.00711.83
5.4.340.0130.00311.83
5.4.330.0190.00011.83
5.4.320.0100.00511.83
5.4.310.0110.01411.83
5.4.300.0100.00311.83
5.4.290.0090.00911.83
5.4.280.0100.00211.83
5.4.270.0100.00011.83
5.4.260.0140.00411.83
5.4.250.0110.01111.83
5.4.240.0080.00811.83
5.4.230.0110.00511.83
5.4.220.0070.00711.83
5.4.210.0110.00011.83
5.4.200.0160.00311.83
5.4.190.0120.00011.83
5.4.180.0160.00011.83
5.4.170.0180.00911.83
5.4.160.0130.00611.83
5.4.150.0090.00911.83
5.4.140.0100.00211.83
5.4.130.0090.00911.83
5.4.120.0180.00411.83
5.4.110.0130.00911.83
5.4.100.0110.00711.83
5.4.90.0090.00911.83
5.4.80.0050.00711.83
5.4.70.0220.00011.83
5.4.60.0100.00511.83
5.4.50.0140.01111.83
5.4.40.0000.01711.83
5.4.30.0100.00411.83
5.4.20.0080.00811.83
5.4.10.0140.00311.83
5.4.00.0110.00311.83
5.3.290.0110.00811.83
5.3.280.0150.00311.83
5.3.270.0070.00211.83
5.3.260.0090.00311.83
5.3.250.0090.00311.83
5.3.240.0130.01011.83
5.3.230.0070.01511.83
5.3.220.0140.00011.83
5.3.210.0160.00311.83
5.3.200.0080.00811.83
5.3.190.0090.00611.83
5.3.180.0030.00711.83
5.3.170.0090.01211.83
5.3.160.0090.00311.83
5.3.150.0100.00311.83
5.3.140.0070.00711.83
5.3.130.0090.00611.83
5.3.120.0070.00711.83
5.3.110.0040.00811.83
5.3.100.0050.00911.83
5.3.90.0110.00011.83
5.3.80.0100.00311.83
5.3.70.0100.00311.83
5.3.60.0000.01011.83
5.3.50.0060.00311.83
5.3.40.0070.00211.83
5.3.30.0120.00011.83
5.3.20.0070.01011.83
5.3.10.0130.01011.83
5.3.00.0090.00911.83
5.2.170.0060.00311.83
5.2.160.0050.00511.83
5.2.150.0050.00511.83
5.2.140.0050.00511.83
5.2.130.0040.00711.83
5.2.120.0140.00011.83
5.2.110.0090.00311.83
5.2.100.0080.01111.83
5.2.90.0060.00911.83
5.2.80.0120.00211.83
5.2.70.0080.00811.83
5.2.60.0090.00311.83
5.2.50.0130.00411.83
5.2.40.0120.00011.83
5.2.30.0030.01211.83
5.2.20.0160.00311.83
5.2.10.0040.00411.83
5.2.00.0020.00511.83
5.1.60.0130.00311.83
5.1.50.0070.00011.83
5.1.40.0070.00511.83
5.1.30.0120.00411.83
5.1.20.0130.00311.83
5.1.10.0100.00011.83
5.1.00.0140.00011.83
5.0.50.0060.00311.83
5.0.40.0090.00011.83
5.0.30.0060.00511.83
5.0.20.0070.00011.83
5.0.10.0020.00511.83
5.0.00.0070.00011.83
4.4.90.0100.00011.83
4.4.80.0100.00311.83
4.4.70.0080.00011.83
4.4.60.0000.00711.83
4.4.50.0000.00511.83
4.4.40.0000.00411.83
4.4.30.0040.00011.83
4.4.20.0060.00011.83
4.4.10.0080.00011.83
4.4.00.0070.00211.83
4.3.110.0040.00211.83
4.3.100.0030.00311.83
4.3.90.0060.00011.83
4.3.80.0040.00411.83
4.3.70.0000.00811.83
4.3.60.0060.00311.83
4.3.50.0000.00511.83
4.3.40.0040.00011.83
4.3.30.0040.00011.83
4.3.20.0000.00411.83
4.3.10.0030.00711.83
4.3.00.0050.00511.83

preferences:
66.42 ms | 401 KiB | 5 Q