3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar; } $foo = new Foo; $blanks = array( "string(empty) \"\"" => "", "string(space) \" \"" => " ", "bool(false)" => FALSE, "bool(true)" => TRUE, "array(empty) {}" => array(), "NULL" => NULL, "string(\"zero\") \"0\"" => "0", "int(0)" => 0, "float(0.0)" => 0.0, "object(stdClass)# (empty) {}" => new stdClass, "public \$bar" => $foo->bar, "string(null byte) \"\\0\"" => "\0" ); $headings = array('type', 'if', 'isset', 'empty', 'is_null'); foreach(array($headings, array_keys($blanks)) as $ord => $arr){ foreach($arr as $val){ static $max = 0; if(strlen($val) > $max){ $max = strlen($val); } } ${"pad_$ord"} = $max; } for($i = 0; $i < count($headings); $i++){ echo str_pad($headings[$i], ${'pad_' . pow(0,$i)}), "|"; } /* $x = str_pad("TRUE", PAD_1) . " | "; $y = str_pad("", PAD_1) . " | "; foreach($arr as $key => $val){ echo str_pad($key, max(array_map('strlen', array_keys($arr)))), " | "; echo $val ? $x : $y; echo isset($val) ? $x : $y; echo empty($val) ? $x : $y; echo is_null($val) ? $x : $y; echo "\n"; } */

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.0140.00416.63
8.3.50.0090.01122.11
8.3.40.0130.00318.71
8.3.30.0110.00418.78
8.3.20.0040.00420.25
8.3.10.0080.00023.71
8.3.00.0030.00617.71
8.2.180.0150.00316.63
8.2.170.0110.00622.96
8.2.160.0140.00022.30
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0090.00026.16
8.2.120.0050.00517.63
8.2.110.0030.00619.31
8.2.100.0130.00018.16
8.2.90.0000.00719.21
8.2.80.0030.00517.97
8.2.70.0090.00017.75
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00421.11
8.2.30.0040.00420.52
8.2.20.0040.00417.69
8.2.10.0040.00418.16
8.2.00.0000.00718.01
8.1.280.0070.01125.92
8.1.270.0060.00323.88
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0070.00321.09
8.1.230.0060.00617.78
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0090.00017.13
8.1.190.0040.00417.10
8.1.180.0000.00818.10
8.1.170.0030.00518.87
8.1.160.0080.00022.05
8.1.150.0000.00718.91
8.1.140.0000.00719.59
8.1.130.0030.00317.73
8.1.120.0050.00217.45
8.1.110.0000.00717.50
8.1.100.0030.00517.45
8.1.90.0040.00417.52
8.1.80.0080.00017.38
8.1.70.0000.00817.44
8.1.60.0030.00517.59
8.1.50.0000.00817.55
8.1.40.0060.00317.55
8.1.30.0070.00417.59
8.1.20.0000.00917.65
8.1.10.0040.00417.64
8.1.00.0030.00517.42
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0000.00718.38
8.0.270.0000.00917.24
8.0.260.0030.00317.32
8.0.250.0040.00416.95
8.0.240.0000.00716.91
8.0.230.0030.00316.94
8.0.220.0000.00716.82
8.0.210.0070.00016.75
8.0.200.0000.00816.86
8.0.190.0000.00816.91
8.0.180.0000.00716.94
8.0.170.0050.00216.77
8.0.160.0030.00616.81
8.0.150.0030.00516.73
8.0.140.0040.00416.90
8.0.130.0000.00613.27
8.0.120.0040.00416.85
8.0.110.0000.00716.94
8.0.100.0050.00316.71
8.0.90.0000.00716.95
8.0.80.0120.00416.84
8.0.70.0070.00016.89
8.0.60.0040.00417.03
8.0.50.0000.00816.75
8.0.30.0120.00817.24
8.0.20.0120.00817.40
8.0.10.0060.00317.02
8.0.00.0090.00916.76
7.4.330.0000.00515.09
7.4.320.0060.00016.63
7.4.300.0040.00416.63
7.4.290.0020.00516.53
7.4.280.0040.00416.66
7.4.270.0030.00316.61
7.4.260.0030.00316.63
7.4.250.0000.00816.52
7.4.240.0020.00516.59
7.4.230.0070.00016.52
7.4.220.0070.01316.74
7.4.210.0110.00816.62
7.4.200.0030.00316.51
7.4.160.0080.00816.54
7.4.150.0090.00917.40
7.4.140.0090.01417.86
7.4.130.0060.01316.57
7.4.120.0100.01016.44
7.4.110.0140.00316.65
7.4.100.0100.01616.46
7.4.90.0070.01416.52
7.4.80.0130.00319.39
7.4.70.0100.00716.45
7.4.60.0090.00916.39
7.4.50.0040.00416.48
7.4.40.0070.01016.54
7.4.30.0140.01116.60
7.4.00.0030.01415.00
7.3.330.0000.00513.32
7.3.320.0000.00513.35
7.3.310.0070.00016.41
7.3.300.0070.00016.37
7.3.290.0000.00716.40
7.3.280.0060.01116.33
7.3.270.0100.00717.40
7.3.260.0070.01116.55
7.3.250.0110.00716.36
7.3.240.0100.00816.50
7.3.230.0100.00716.61
7.3.210.0160.00616.39
7.3.200.0090.00816.65
7.3.190.0090.00916.42
7.3.180.0070.01016.45
7.3.170.0040.01216.62
7.3.160.0060.00916.40
7.2.330.0110.00816.70
7.2.320.0130.00616.58
7.2.310.0030.01316.69
7.2.300.0090.01216.52
7.2.290.0120.00916.52
7.2.60.0030.01017.07
7.2.00.0060.01019.45
7.1.200.0040.01115.63
7.1.100.0000.01118.34
7.1.70.0000.00717.19
7.1.60.0140.01019.43
7.1.50.0080.00316.87
7.1.00.0100.07022.28
7.0.200.0600.00714.68
7.0.60.0100.05020.03
7.0.50.0170.07018.04
7.0.40.0030.05720.09
7.0.30.0400.06720.24
7.0.20.0200.06320.08
7.0.10.0070.08320.23
7.0.00.0130.07720.16
5.6.280.0000.03321.08
5.6.210.0070.05720.54
5.6.200.0130.07318.19
5.6.190.0130.07020.48
5.6.180.3130.04320.42
5.6.170.0330.07020.46
5.6.160.0030.04020.57
5.6.150.0070.08018.17
5.6.140.0170.06718.18
5.6.130.0030.05018.18
5.6.120.0000.05321.05
5.6.110.0070.05020.98
5.6.100.0130.07021.06
5.6.90.0000.09320.93
5.6.80.0100.08020.39
5.5.350.0230.05720.36
5.5.340.0100.07718.05
5.5.330.0100.08020.13
5.5.320.0230.07720.35
5.5.310.0270.04720.24
5.5.300.0000.07018.00
5.5.290.0070.08717.99
5.5.280.0100.08020.91
5.5.270.0100.08020.67
5.5.260.0030.08320.98
5.5.250.0030.08020.50
5.5.240.0030.07320.29
5.4.450.0330.08319.34
5.4.440.0300.06319.61
5.4.430.0230.07319.61
5.4.420.0130.06719.58
5.4.410.0570.05719.32
5.4.400.0670.06718.84
5.4.390.0770.07718.98
5.4.380.0500.06319.29
5.4.370.0100.05719.03
5.4.360.0270.04719.14
5.4.350.0130.05319.37
5.4.340.0130.05318.87
5.4.320.0200.05319.01
5.4.310.0330.04719.38
5.4.300.0130.05719.05
5.4.290.0200.06319.25
5.4.280.0230.05719.25
5.4.270.0070.06719.37
5.4.260.0170.05019.25
5.4.250.0770.06719.14
5.4.240.0700.07019.25
5.4.230.0600.06719.29
5.4.220.0570.06019.27
5.4.210.0000.06719.02
5.4.200.0370.04318.96
5.4.190.0200.05019.36
5.4.180.0200.05319.36
5.4.170.0130.05019.05
5.4.160.0130.05719.23
5.4.150.0200.06319.18
5.4.140.0370.06316.57
5.4.130.0200.05016.34
5.4.120.0270.04716.34
5.4.110.0200.04316.43
5.4.100.0330.05716.60
5.4.90.0200.04316.62
5.4.80.0300.05016.51
5.4.70.0130.05716.40
5.4.60.0270.06716.62
5.4.50.0570.04316.38
5.4.40.0570.06716.57
5.4.30.0670.04716.61
5.4.20.0670.06016.58
5.4.10.0570.05716.56
5.4.00.0370.04315.95

preferences:
52.15 ms | 401 KiB | 5 Q