3v4l.org

run code in 300+ PHP versions simultaneously
<?php $isset = true; $array = array(); $notSetArray = array(0=>''); $string = ''; // Test Source function TestEmpty() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { empty($array); ++$i; } echo (microtime(true) - $t); } function TestEmpty2() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { (! $array ); ++$i; } echo (microtime(true) - $t); } function TestEmpty3() { $array = null; $i = 0; /* The Test */ $t = microtime(true); while($i < 2000) { ($array !== []); ++$i; } echo (microtime(true) - $t); } TestEmpty(); echo "\n\n"; TestEmpty2(); echo "\n\n"; TestEmpty3();

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)
7.3.120.0030.01214.91
7.3.110.0060.00314.93
7.3.100.0030.01314.95
7.3.90.0000.01414.81
7.3.80.0060.00314.91
7.3.70.0030.01014.75
7.3.60.0030.01014.89
7.3.50.0100.00314.90
7.3.40.0070.00714.68
7.3.30.0090.00314.63
7.3.20.0030.01016.73
7.3.10.0040.00916.77
7.3.00.0100.00516.61
7.2.240.0040.01115.00
7.2.230.0070.00714.87
7.2.220.0070.01015.17
7.2.210.0060.00915.21
7.2.200.0070.00715.17
7.2.190.0080.00514.79
7.2.180.0040.00814.80
7.2.170.0080.00814.83
7.2.160.0060.00915.05
7.2.150.0070.00717.06
7.2.140.0070.00616.89
7.2.130.0080.00616.88
7.2.120.0070.00616.97
7.2.110.0080.00816.91
7.2.100.0070.00616.78
7.2.90.0070.00616.94
7.2.80.0010.01316.90
7.2.70.0050.00916.89
7.2.60.0050.00817.01
7.2.50.0080.00716.96
7.2.40.0080.00616.89
7.2.30.0060.00816.89
7.2.20.0040.00916.90
7.2.10.0050.00716.93
7.2.00.0070.00917.52
7.1.330.0090.00616.02
7.1.320.0080.00815.70
7.1.310.0040.01215.70
7.1.300.0040.01115.66
7.1.290.0100.00315.55
7.1.280.0100.00715.98
7.1.270.0030.01015.82
7.1.260.0060.01015.87
7.1.250.0030.00915.81
7.1.240.0110.00015.79
7.1.230.0040.01115.88
7.1.220.0040.00715.66
7.1.210.0060.00915.63
7.1.200.0040.00415.57
7.1.190.0030.01115.71
7.1.180.0030.01315.93
7.1.170.0040.00815.81
7.1.160.0030.01215.93
7.1.150.0060.00915.64
7.1.140.0070.00715.84
7.1.130.0090.00315.81
7.1.120.0000.01415.85
7.1.110.0040.01215.73
7.1.100.0000.01215.49
7.1.90.0070.00715.81
7.1.80.0040.00715.54
7.1.70.0070.00416.41
7.1.60.0080.01017.55
7.1.50.0130.01025.07
7.1.40.0040.01115.61
7.1.30.0030.00615.75
7.1.20.0040.01415.96
7.1.10.0030.01015.79
7.1.00.0060.03518.95
7.0.330.0030.00915.38
7.0.320.0030.00915.42
7.0.310.0060.01015.43
7.0.300.0070.00715.30
7.0.290.0000.01715.25
7.0.280.0100.00315.09
7.0.270.0110.00615.13
7.0.260.0050.00515.52
7.0.250.0060.00915.34
7.0.240.0030.00715.54
7.0.230.0110.00315.32
7.0.220.0110.00315.41
7.0.210.0000.01115.21
7.0.200.0030.00716.04
7.0.190.0130.00015.47
7.0.180.0120.00315.28
7.0.170.0030.00615.52
7.0.160.0060.00615.36
7.0.150.0070.00715.31
7.0.140.0020.04518.78
7.0.130.0040.01115.61
7.0.120.0100.00315.27
7.0.110.0040.01115.41
7.0.100.0050.04717.59
7.0.90.0030.04817.65
7.0.80.0070.03717.56
7.0.70.0050.04117.59
7.0.60.0060.04117.65
7.0.50.0110.03818.76
7.0.40.0080.04116.87
7.0.30.0120.04216.78
7.0.20.0100.04016.83
7.0.10.0080.04616.81
7.0.00.0030.04616.63
5.6.380.0000.01413.73
5.6.370.0000.01513.90
5.6.360.0030.01014.30
5.6.350.0030.01014.34
5.6.340.0030.00614.37
5.6.330.0120.00314.22
5.6.320.0100.00714.12
5.6.310.0140.00014.45
5.6.300.0060.00614.39
5.6.290.0000.01614.26
5.6.280.0050.04017.73
5.6.270.0030.00714.31
5.6.260.0000.00814.32
5.6.250.0070.04217.55
5.6.240.0120.03317.51
5.6.230.0070.04417.31
5.6.220.0060.04217.47
5.6.210.0120.03717.45
5.6.200.0070.04117.70
5.6.190.0100.03617.71
5.6.180.0120.04217.64
5.6.170.0060.04317.67
5.6.160.0080.04317.65
5.6.150.0050.04417.58
5.6.140.0050.04317.57
5.6.130.0070.04817.61
5.6.120.0120.04017.54
5.6.110.0070.04617.60
5.6.100.0100.04417.73
5.6.90.0100.04417.60
5.6.80.0050.03217.19
5.6.70.0080.04117.39
5.6.60.0100.03317.17
5.6.50.0040.02617.22
5.6.40.0040.02417.13
5.6.30.0070.02717.29
5.6.20.0030.02317.07
5.6.10.0140.04017.29
5.6.00.0070.04017.31
5.5.380.0100.03715.96
5.5.370.0080.04416.02
5.5.360.0030.04315.97
5.5.350.0090.04416.02
5.5.340.0080.04016.21
5.5.330.0030.04716.18
5.5.320.0030.03716.21
5.5.310.0070.04016.12
5.5.300.0100.03716.24
5.5.290.0100.03816.24
5.5.280.0030.04716.16
5.5.270.0030.04516.18
5.5.260.0060.03616.18
5.5.250.0040.04316.13
5.5.240.0090.04015.90
5.5.230.0080.03815.88
5.5.220.0030.02715.85
5.5.210.0040.02615.90
5.5.200.0030.02415.92
5.5.190.0050.02115.87
5.5.180.0080.03815.87
5.5.170.0100.00311.64
5.5.160.0070.03715.90
5.5.150.0040.02415.92
5.5.140.0030.02715.85
5.5.130.0070.03015.79
5.5.120.0030.02815.85
5.5.110.0060.02015.90
5.5.100.0080.04215.88
5.5.90.0070.04215.80
5.5.80.0050.03415.87
5.5.70.0100.03715.87
5.5.60.0040.02915.87
5.5.50.0050.03215.82
5.5.40.0050.03315.83
5.5.30.0030.04515.83
5.5.20.0020.03515.87
5.5.10.0070.02215.77
5.5.00.0080.03715.85
5.4.450.0070.04315.59
5.4.440.0050.02815.41
5.4.430.0070.04415.58
5.4.420.0070.04515.54
5.4.410.0050.04015.44
5.4.400.0080.03515.39
5.4.390.0060.04215.44
5.4.380.0030.03415.39
5.4.370.0080.02815.24
5.4.360.0030.02315.34
5.4.350.0020.02715.26
5.4.340.0050.03615.38
5.4.330.0030.00911.64
5.4.320.0050.02415.42
5.4.310.0090.03015.40
5.4.300.0000.02515.25
5.4.290.0040.02415.33
5.4.280.0030.02615.24
5.4.270.0080.03815.42
5.4.260.0090.02015.42
5.4.250.0020.03615.36
5.4.240.0070.04215.42
5.4.230.0050.03615.26
5.4.220.0040.03115.34
5.4.210.0060.03115.34
5.4.200.0040.02215.25
5.4.190.0070.02515.43
5.4.180.0080.02215.42
5.4.170.0050.02815.33
5.4.160.0070.03015.40
5.4.150.0060.02315.38
5.4.140.0070.03514.04
5.4.130.0040.02113.99
5.4.120.0050.03014.04
5.4.110.0050.03614.05
5.4.100.0050.03714.01
5.4.90.0020.04214.00
5.4.80.0070.03814.10
5.4.70.0050.03714.09
5.4.60.0050.04114.03
5.4.50.0100.03814.05
5.4.40.0050.04014.09
5.4.30.0110.03613.93
5.4.20.0000.04513.98
5.4.10.0060.03813.98
5.4.00.0020.04513.73
5.3.290.0050.04113.21
5.3.280.0030.04313.11
5.3.270.0030.03413.09
5.3.260.0120.03713.18
5.3.250.0020.02213.06
5.3.240.0020.02413.11
5.3.230.0050.03313.20
5.3.220.0050.02013.13
5.3.210.0020.02513.17
5.3.200.0050.04113.13
5.3.190.0040.04613.10
5.3.180.0050.03113.08
5.3.170.0070.03513.11
5.3.160.0080.03813.09
5.3.150.0060.04113.15
5.3.140.0090.03513.09
5.3.130.0080.03813.06
5.3.120.0050.04313.06
5.3.110.0050.04013.13
5.3.100.0050.04212.88
5.3.90.0030.04012.82
5.3.80.0030.03812.88
5.3.70.0030.04212.88
5.3.60.0040.04012.85
5.3.50.0080.01812.85
5.3.40.0030.02612.79
5.3.30.0080.02812.83
5.3.20.0070.03712.63
5.3.10.0090.03212.62
5.3.00.0110.03312.67
5.2.170.0060.02911.40
5.2.160.0000.04011.39
5.2.150.0020.03711.46
5.2.140.0020.03311.33
5.2.130.0100.02811.43
5.2.120.0030.03411.43
5.2.110.0050.03011.39
5.2.100.0050.03411.32
5.2.90.0050.03311.38
5.2.80.0070.03211.31
5.2.70.0050.03211.38
5.2.60.0070.02211.40
5.2.50.0050.03111.34
5.2.40.0030.02011.31
5.2.30.0020.03311.36
5.2.20.0070.03211.33
5.2.10.0050.03311.24
5.2.00.0000.03311.25
5.1.60.0010.02110.86
5.1.50.0040.02310.82
5.1.40.0060.02610.82
5.1.30.0050.01910.98
5.1.20.0050.02810.97
5.1.10.0050.02510.90
5.1.00.0030.02210.78
5.0.50.0070.02210.15
5.0.40.0020.0249.98
5.0.30.0000.0359.97
5.0.20.0020.0279.92
5.0.10.0020.0249.96
5.0.00.0070.0209.94
4.4.90.0050.0149.90
4.4.80.0010.0209.90
4.4.70.0020.0199.90
4.4.60.0040.0179.90
4.4.50.0050.0109.90
4.4.40.0000.0289.90
4.4.30.0000.0229.90
4.4.20.0020.0159.90
4.4.10.0030.0189.90
4.4.00.0030.0239.90
4.3.110.0020.0209.90
4.3.100.0000.0209.90
4.3.90.0030.0189.90
4.3.80.0000.0319.90
4.3.70.0030.0189.90
4.3.60.0020.0209.90
4.3.50.0000.0209.90
4.3.40.0000.0309.90
4.3.30.0000.0229.90
4.3.20.0020.0189.90
4.3.10.0030.0189.90
4.3.00.0000.0209.90

preferences:
36.73 ms | 401 KiB | 5 Q