3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[0] = (object) array( 'time' => '1403071646', 'netin' => '17.75', 'netout' => '22.5' ); $data[1] = (object) array( 'time' => '1403071647', 'netin' => '17.75', 'netout' => '22.5' ); $data[2] = (object) array( 'time' => '1403071649', 'netin' => '17.75', 'netout' => '22.5' ); // trying to make lines 15-19 become the following: // $output .= "{'x':'".date('Y-m-d H:i:s', $stat->time)."','y':'".number_format(round($stat->netin) / 1024, 2)."','z':'".number_format(round($stat->netout) / 1024, 2)."'}"; function chart_data($data, $items) { $count = count($data); $i = 1; $output = ''; foreach ($data as $stat) { $output .= '{'; foreach ($items as $key => $func) { $output .= "'".$key."':'".$func($stat)."'"; } $output .= '}'; if ($i < $count) { $output .= ","; } $output .= "\n"; $i++; } echo $output; } $items = array( 'x' => function ($stat) { return date('Y-m-d H:i:s', $stat->time); }, 'y' => function ($stat) { return number_format(round($stat->netin) / 1024, 2); }, 'z' => function ($stat) { return number_format(round($stat->netout) / 1024, 2); } ); chart_data($data, $items);

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.0180.00416.88
8.3.50.0110.00822.19
8.3.40.0070.00719.04
8.3.30.0070.00719.36
8.3.20.0040.00420.48
8.3.10.0030.00623.77
8.3.00.0060.00319.75
8.2.180.0070.00718.54
8.2.170.0070.00718.95
8.2.160.0140.00022.96
8.2.150.0080.00025.66
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00422.20
8.2.110.0090.00020.28
8.2.100.0040.00817.95
8.2.90.0000.00719.34
8.2.80.0040.00418.05
8.2.70.0090.00017.75
8.2.60.0000.00918.05
8.2.50.0090.00018.07
8.2.40.0050.00320.19
8.2.30.0080.00018.40
8.2.20.0040.00417.89
8.2.10.0000.00818.15
8.2.00.0040.00418.06
8.1.280.0180.00325.92
8.1.270.0090.00623.97
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.72
8.1.230.0040.00720.94
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0060.00317.63
8.1.190.0040.00417.48
8.1.180.0060.00318.10
8.1.170.0080.00018.54
8.1.160.0030.00521.98
8.1.150.0040.00418.73
8.1.140.0060.00317.71
8.1.130.0000.00718.02
8.1.120.0040.00417.68
8.1.110.0040.00417.63
8.1.100.0000.00817.73
8.1.90.0000.00717.56
8.1.80.0070.00017.57
8.1.70.0000.00717.61
8.1.60.0040.00417.77
8.1.50.0090.00017.49
8.1.40.0000.00817.57
8.1.30.0050.00617.82
8.1.20.0040.00417.66
8.1.10.0070.00417.62
8.1.00.0000.00817.69
8.0.300.0070.00020.92
8.0.290.0040.00417.18
8.0.280.0000.00718.59
8.0.270.0000.00717.40
8.0.260.0030.00317.40
8.0.250.0000.00717.21
8.0.240.0030.00317.09
8.0.230.0000.00717.07
8.0.220.0070.00017.16
8.0.210.0070.00017.11
8.0.200.0040.00417.05
8.0.190.0040.00417.16
8.0.180.0050.00516.94
8.0.170.0040.00417.07
8.0.160.0070.00017.14
8.0.150.0000.00716.93
8.0.140.0030.00317.04
8.0.130.0000.00513.45
8.0.120.0040.00417.17
8.0.110.0040.00416.99
8.0.100.0040.00417.16
8.0.90.0000.00816.96
8.0.80.0110.01117.07
8.0.70.0050.00316.93
8.0.60.0040.00417.09
8.0.50.0000.00816.89
8.0.30.0130.00617.18
8.0.20.0120.00517.40
8.0.10.0040.00417.34
8.0.00.0140.00817.03
7.4.330.0000.00515.00
7.4.320.0000.00816.80
7.4.300.0070.00016.57
7.4.290.0000.00716.71
7.4.280.0040.00416.71
7.4.270.0000.00716.66
7.4.260.0030.00313.29
7.4.250.0040.00416.70
7.4.240.0030.00416.69
7.4.230.0000.00716.77
7.4.220.0150.00316.58
7.4.210.0070.00816.74
7.4.200.0070.00016.76
7.4.190.0030.00316.60
7.4.160.0130.00316.82
7.4.150.0210.00317.40
7.4.140.0100.01017.86
7.4.130.0120.00516.60
7.4.120.0070.00916.66
7.4.110.0140.00316.59
7.4.100.0130.00916.69
7.4.90.0000.01616.69
7.4.80.0120.00919.39
7.4.70.0100.01016.88
7.4.60.0110.00716.43
7.4.50.0000.00916.77
7.4.40.0110.00716.67
7.4.30.0140.00316.60
7.4.00.0070.00815.26
7.3.330.0000.00513.44
7.3.320.0030.00313.55
7.3.310.0040.00416.57
7.3.300.0030.00316.61
7.3.290.0040.01116.64
7.3.280.0050.01216.57
7.3.270.0070.01017.40
7.3.260.0130.00416.70
7.3.250.0070.01516.73
7.3.240.0140.00316.78
7.3.230.0110.00816.66
7.3.210.0110.00716.63
7.3.200.0120.00619.39
7.3.190.0140.00616.55
7.3.180.0030.01316.73
7.3.170.0030.01216.58
7.3.160.0030.01316.78
7.3.120.0070.00714.79
7.2.330.0030.01416.91
7.2.320.0080.01116.61
7.2.310.0030.01317.00
7.2.300.0140.00316.59
7.2.290.0000.02016.93
7.2.60.0030.01317.10
7.2.00.0110.00719.62
7.1.200.0060.00616.02
7.1.100.0040.01118.28
7.1.70.0030.01217.18
7.1.60.0000.02419.46
7.1.50.0090.01316.97
7.1.00.0130.06722.44
7.0.200.0030.00616.71
7.0.140.0000.07022.04
7.0.100.0070.08319.98
7.0.90.0070.07719.91
7.0.80.0170.07320.02
7.0.70.0430.05319.86
7.0.60.0500.07319.89
7.0.50.0370.08320.38
7.0.40.0070.08020.17
7.0.30.0030.09320.04
7.0.20.0030.07020.18
7.0.10.0100.08020.05
7.0.00.0030.09020.14
5.6.280.0170.06320.93
5.6.250.0030.08320.62
5.6.240.0030.07020.56
5.6.230.0130.07020.59
5.6.220.0030.07020.52
5.6.210.0130.07320.54
5.6.200.0170.05321.11
5.6.190.0100.06321.03
5.6.180.0000.07720.95
5.6.170.0130.07321.05
5.6.160.0070.05721.08
5.6.150.0030.08721.02
5.6.140.0070.06721.04
5.6.130.0000.08721.01
5.6.120.0130.07321.02
5.6.110.0000.08321.17
5.6.100.0130.07721.05
5.6.90.0130.04321.05
5.6.80.0170.07020.44
5.6.70.0070.07020.50
5.6.60.0100.06320.43
5.6.50.0170.06320.46
5.6.40.0100.08020.38
5.6.30.0200.07020.48
5.6.20.0100.06320.40
5.6.10.0170.06720.45
5.6.00.0070.07720.30
5.5.380.0100.06720.47
5.5.370.0130.07020.38
5.5.360.0130.07720.37
5.5.350.0100.06320.36
5.5.340.0070.08720.93
5.5.330.0030.08720.78
5.5.320.0000.05320.77
5.5.310.0030.08320.62
5.5.300.0030.08720.89
5.5.290.0170.06720.90
5.5.280.0130.05020.88
5.5.270.0100.08720.88
5.5.260.0070.07720.79
5.5.250.0100.08020.66
5.5.240.0070.07720.33
5.5.230.0130.08320.25
5.5.220.0130.07720.28
5.5.210.0030.08320.16
5.5.200.0070.07320.17
5.5.190.0030.05020.26
5.5.180.0030.06720.25
5.5.160.0030.08720.12
5.5.150.0070.07720.25
5.5.140.0130.06720.19
5.5.130.0200.07020.24
5.5.120.0030.08020.00
5.5.110.0030.06720.18
5.5.100.0100.06720.13
5.5.90.0130.06719.98
5.5.80.0100.06320.08
5.5.70.0070.08720.18
5.5.60.0070.07720.07
5.5.50.0100.07720.17
5.5.40.0030.08720.13
5.5.30.0130.05020.04
5.5.20.0030.06719.95
5.5.10.0130.07320.07
5.5.00.0030.08320.12
5.4.450.0070.04719.52
5.4.440.0030.04719.63
5.4.430.0130.07019.50
5.4.420.0030.07719.51
5.4.410.0170.07019.20
5.4.400.0100.07719.13
5.4.390.0070.04318.97
5.4.380.0100.07318.91
5.4.370.0070.08019.21
5.4.360.0100.05319.05
5.4.350.0070.06019.12
5.4.340.0030.05319.22
5.4.320.0100.05719.04
5.4.310.0030.08719.09
5.4.300.0130.05019.18
5.4.290.0170.06319.22
5.4.280.0000.08318.96
5.4.270.0070.04719.29
5.4.260.0000.05019.13
5.4.250.0100.07018.93
5.4.240.0130.05018.95
5.4.230.0030.06019.29
5.4.220.0100.06319.26
5.4.210.0070.05718.98
5.4.200.0070.07718.95
5.4.190.0000.08318.96
5.4.180.0170.04019.15
5.4.170.0170.07019.28
5.4.160.0070.07018.99
5.4.150.0070.05019.07
5.4.140.0100.07316.32
5.4.130.0000.07716.31
5.4.120.0000.06016.42
5.4.110.0130.06316.63
5.4.100.0030.03716.59
5.4.90.0130.07016.52
5.4.80.0030.07716.53
5.4.70.0100.06716.43
5.4.60.0130.05316.52
5.4.50.0130.06316.42
5.4.40.0030.04016.59
5.4.30.0100.06716.36
5.4.20.0170.06316.46
5.4.10.0170.06716.48
5.4.00.0000.07015.83
5.3.290.0100.05314.86
5.3.280.0070.07014.86
5.3.270.0100.07014.86
5.3.260.0070.06014.86
5.3.250.0030.05014.86
5.3.240.0000.05714.86
5.3.230.0030.06714.86
5.3.220.0200.07014.86
5.3.210.0170.05714.86
5.3.200.0070.06314.86
5.3.190.0070.06014.86
5.3.180.0070.06014.86
5.3.170.0170.07314.86
5.3.160.0000.07014.86
5.3.150.0000.07714.86
5.3.140.0030.07014.86
5.3.130.0000.04314.86
5.3.120.0070.07714.86
5.3.110.0100.07014.86
5.3.100.0100.07014.86
5.3.90.0200.06014.86
5.3.80.0030.07314.86
5.3.70.0070.04314.86
5.3.60.0000.04714.86
5.3.50.0030.04014.86
5.3.40.0030.06314.86
5.3.30.0100.07714.86
5.3.20.0070.06714.86
5.3.10.0030.05014.86
5.3.00.0070.05314.86
5.2.170.0030.05314.86
5.2.160.0030.06714.86
5.2.150.0070.06314.86
5.2.140.0130.06014.86
5.2.130.0070.06314.86
5.2.120.0000.06714.86
5.2.110.0130.04314.86
5.2.100.0070.05714.86
5.2.90.0030.05714.86
5.2.80.0100.05714.86
5.2.70.0100.04714.86
5.2.60.0030.04314.86
5.2.50.0000.07014.86
5.2.40.0030.03314.86
5.2.30.0070.04014.86
5.2.20.0070.02714.86
5.2.10.0030.06014.86
5.2.00.0070.05714.86
5.1.60.0030.05714.86
5.1.50.0000.06014.86
5.1.40.0000.05714.86
5.1.30.0100.05314.86
5.1.20.0100.04014.86
5.1.10.0070.04714.86
5.1.00.0070.05014.86
5.0.50.0100.04014.86
5.0.40.0030.04314.86
5.0.30.0030.06314.86
5.0.20.0000.04314.86
5.0.10.0070.04014.86
5.0.00.0100.03014.86
4.4.90.0000.03714.86
4.4.80.0000.02014.86
4.4.70.0030.03714.86
4.4.60.0030.03314.86
4.4.50.0030.03314.86
4.4.40.0070.04314.86
4.4.30.0070.03014.86
4.4.20.0000.04014.86
4.4.10.0030.03014.86
4.4.00.0000.05714.86
4.3.110.0000.02314.86
4.3.100.0000.03714.86
4.3.90.0030.02714.86
4.3.80.0000.05314.86
4.3.70.0000.03314.86
4.3.60.0000.02314.86
4.3.50.0000.03714.86
4.3.40.0000.05314.86
4.3.30.0000.03714.86
4.3.20.0000.04314.86
4.3.10.0030.03314.86
4.3.00.0070.03014.86

preferences:
48.42 ms | 400 KiB | 5 Q