3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[0] = array( 'time' => '1403071646', 'netin' => '17.75', 'netout' => '22.5' ); $data[1] = array( 'time' => '1403071647', 'netin' => '17.75', 'netout' => '22.5' ); $data[2] = 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.0110.00718.54
8.3.50.0120.00522.05
8.3.40.0160.00319.09
8.3.30.0080.00619.26
8.3.20.0000.00720.29
8.3.10.0030.00523.61
8.3.00.0050.00319.50
8.2.180.0120.00325.92
8.2.170.0110.00719.04
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0040.00420.07
8.2.110.0060.00321.11
8.2.100.0000.01318.03
8.2.90.0000.00818.28
8.2.80.0040.00420.66
8.2.70.0040.00417.75
8.2.60.0060.00317.63
8.2.50.0050.00318.29
8.2.40.0060.00319.61
8.2.30.0040.00418.33
8.2.20.0050.00317.91
8.2.10.0000.00818.16
8.2.00.0070.00017.89
8.1.280.0090.00625.92
8.1.270.0080.00823.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00622.14
8.1.230.0060.00620.89
8.1.220.0000.00817.77
8.1.210.0040.00418.97
8.1.200.0090.00017.61
8.1.190.0040.00417.48
8.1.180.0080.00018.10
8.1.170.0040.00417.69
8.1.160.0050.00222.02
8.1.150.0040.00418.87
8.1.140.0000.00717.66
8.1.130.0030.00317.94
8.1.120.0030.00517.77
8.1.110.0040.00417.62
8.1.100.0050.00317.68
8.1.90.0030.00517.75
8.1.80.0040.00417.68
8.1.70.0000.00717.56
8.1.60.0040.00417.66
8.1.50.0030.00517.52
8.1.40.0030.00617.65
8.1.30.0000.01117.87
8.1.20.0000.00817.78
8.1.10.0040.00417.73
8.1.00.0040.00417.63
8.0.300.0040.00420.16
8.0.290.0050.00316.88
8.0.280.0040.00418.54
8.0.270.0000.00717.39
8.0.260.0000.00617.40
8.0.250.0000.00817.13
8.0.240.0030.00317.04
8.0.230.0030.00317.00
8.0.220.0000.00717.12
8.0.210.0000.00717.12
8.0.200.0050.00317.13
8.0.190.0000.00816.96
8.0.180.0050.00316.93
8.0.170.0000.00717.09
8.0.160.0050.00216.90
8.0.150.0050.00216.96
8.0.140.0000.00717.05
8.0.130.0000.00613.34
8.0.120.0030.00516.89
8.0.110.0000.00817.07
8.0.100.0040.00416.90
8.0.90.0030.00516.83
8.0.80.0100.00717.08
8.0.70.0040.00416.98
8.0.60.0040.00416.90
8.0.50.0000.00817.09
8.0.30.0130.00717.38
8.0.20.0090.00917.40
8.0.10.0000.00717.00
8.0.00.0090.01216.98
7.4.330.0050.00015.00
7.4.320.0030.00516.73
7.4.300.0060.00016.71
7.4.290.0050.00316.75
7.4.280.0080.00016.69
7.4.270.0040.00416.76
7.4.260.0080.00016.75
7.4.250.0000.00716.71
7.4.240.0060.00216.70
7.4.230.0030.00316.53
7.4.220.0090.01716.78
7.4.210.0090.00716.72
7.4.200.0000.00716.43
7.4.190.0030.00316.87
7.4.160.0090.00616.75
7.4.150.0070.01417.40
7.4.140.0080.01017.86
7.4.130.0100.00916.69
7.4.120.0060.01116.76
7.4.110.0070.01616.79
7.4.100.0160.00316.63
7.4.90.0150.00616.56
7.4.80.0180.00619.39
7.4.70.0060.01216.72
7.4.60.0160.00016.80
7.4.50.0000.00416.59
7.4.40.0060.01016.70
7.4.30.0130.00316.52
7.4.00.0030.01415.11
7.3.330.0000.00613.40
7.3.320.0030.00313.36
7.3.310.0040.00416.54
7.3.300.0070.00016.51
7.3.290.0030.00316.44
7.3.280.0070.01016.48
7.3.270.0070.01617.40
7.3.260.0100.00716.65
7.3.250.0100.01216.69
7.3.240.0030.01316.75
7.3.230.0120.00616.64
7.3.210.0160.00716.46
7.3.200.0060.01219.39
7.3.190.0030.01316.63
7.3.180.0030.01416.71
7.3.170.0100.00616.81
7.3.160.0070.01016.65
7.3.120.0000.01414.92
7.3.10.0040.00416.84
7.3.00.0110.00416.70
7.2.330.0100.00716.61
7.2.320.0160.00616.90
7.2.310.0030.01316.87
7.2.300.0070.01117.01
7.2.290.0030.01516.82
7.2.130.0090.00616.93
7.2.120.0080.00516.84
7.2.110.0030.01017.05
7.2.100.0070.00516.97
7.2.90.0040.01117.04
7.2.80.0050.01016.76
7.2.70.0120.00416.88
7.2.60.0060.01017.01
7.2.50.0030.00817.18
7.2.40.0060.00817.03
7.2.30.0070.00717.01
7.2.20.0050.00717.01
7.2.10.0110.00716.92
7.2.00.0050.00717.08
7.1.250.0100.00515.73
7.1.240.0070.00715.49
7.1.230.0070.00715.70
7.1.220.0070.00716.11
7.1.210.0070.01015.82
7.1.200.0070.00715.71
7.1.190.0090.00915.77
7.1.180.0120.00615.96
7.1.170.0060.00616.02
7.1.160.0070.01115.98
7.1.150.0070.00715.90
7.1.140.0100.00315.73
7.1.130.0070.00415.79
7.1.120.0080.00415.59
7.1.110.0110.00416.06
7.1.100.0030.00915.71
7.1.90.0090.01215.83
7.1.80.0110.00415.50
7.1.70.0060.00616.57
7.1.60.0060.01417.61
7.1.50.0090.01116.55
7.1.40.0120.00315.94
7.1.30.0110.00415.77
7.1.20.0110.00315.48
7.1.10.0060.01215.77
7.1.00.0120.03718.92
7.0.330.0110.00315.45
7.0.320.0080.00815.38
7.0.310.0130.00315.40
7.0.300.0100.00315.26
7.0.290.0070.00715.51
7.0.280.0070.00715.11
7.0.270.0080.00415.52
7.0.260.0070.01015.35
7.0.250.0000.01115.41
7.0.240.0060.00615.44
7.0.230.0030.00915.59
7.0.220.0070.00715.48
7.0.210.0040.00815.36
7.0.200.0070.00416.21
7.0.190.0070.00715.52
7.0.180.0110.00415.57
7.0.170.0100.00715.50
7.0.160.0100.00615.42
7.0.150.0150.00015.42
7.0.140.0030.04218.71
7.0.130.0060.00615.43
7.0.120.0040.01115.17
7.0.110.0110.00415.63
7.0.100.0080.04018.69
7.0.90.0130.03418.67
7.0.80.0070.04418.62
7.0.70.0020.02818.63
7.0.60.0090.04118.57
7.0.50.0030.03518.82
7.0.40.0080.03516.53
7.0.30.0000.05116.73
7.0.20.0050.03816.83
7.0.10.0050.02716.85
7.0.00.0090.04616.79
5.6.380.0030.01014.54
5.6.370.0070.00314.46
5.6.360.0040.00714.26
5.6.350.0030.01014.69
5.6.340.0040.00914.56
5.6.330.0130.00014.06
5.6.320.0040.00714.49
5.6.310.0030.01214.30
5.6.300.0030.01014.57
5.6.290.0060.01014.19
5.6.280.0020.04317.77
5.6.270.0040.00914.20
5.6.260.0080.00414.36
5.6.250.0050.04117.54
5.6.240.0090.04117.59
5.6.230.0080.04117.48
5.6.220.0050.03317.56
5.6.210.0050.04717.52
5.6.200.0080.04317.87
5.6.190.0030.03017.83
5.6.180.0030.03817.73
5.6.170.0070.02717.55
5.6.160.0050.04717.81
5.6.150.0060.03617.71
5.6.140.0050.03817.64
5.6.130.0080.04117.78
5.6.120.0090.04517.84
5.6.110.0000.04717.69
5.6.100.0030.04617.72
5.6.90.0060.04517.71
5.6.80.0050.04617.35
5.6.70.0030.03717.30
5.6.60.0110.03917.31
5.6.50.0020.04717.55
5.6.40.0050.04617.47
5.6.30.0030.04217.55
5.6.20.0070.03517.46
5.6.10.0030.04017.31
5.6.00.0090.04417.32
5.5.380.0050.04215.97
5.5.370.0030.04615.74
5.5.360.0100.03515.95
5.5.350.0030.04315.78
5.5.340.0070.04216.21
5.5.330.0040.03716.16
5.5.320.0040.02716.08
5.5.310.0050.04416.12
5.5.300.0070.03816.06
5.5.290.0050.03615.95
5.5.280.0050.02516.25
5.5.270.0050.03816.21
5.5.260.0020.04916.05
5.5.250.0050.03916.11
5.5.240.0030.04115.80
5.5.230.0080.04015.75
5.5.220.0030.02115.58
5.5.210.0020.03615.69
5.5.200.0050.03015.66
5.5.190.0020.04315.69
5.5.180.0050.03015.70
5.5.170.0000.01411.36
5.5.160.0080.04015.85
5.5.150.0130.02815.79
5.5.140.0030.03915.79
5.5.130.0050.04015.67
5.5.120.0030.03015.51
5.5.110.0070.03715.70
5.5.100.0050.02415.63
5.5.90.0070.03415.76
5.5.80.0100.02715.70
5.5.70.0090.03715.69
5.5.60.0070.03815.58
5.5.50.0060.03015.68
5.5.40.0070.03515.68
5.5.30.0000.02515.78
5.5.20.0070.01815.54
5.5.10.0020.02415.58
5.5.00.0020.02515.52
5.4.450.0060.02815.35
5.4.440.0030.04115.52
5.4.430.0030.03215.41
5.4.420.0090.03815.42
5.4.410.0020.04515.34
5.4.400.0050.04015.04
5.4.390.0030.03315.15
5.4.380.0050.03015.20
5.4.370.0080.02715.29
5.4.360.0070.04015.20
5.4.350.0080.03614.99
5.4.340.0070.03315.17
5.4.330.0030.00611.22
5.4.320.0080.02515.13
5.4.310.0020.03115.06
5.4.300.0080.03815.00
5.4.290.0030.04015.02
5.4.280.0050.02015.06
5.4.270.0040.03515.11
5.4.260.0060.04115.13
5.4.250.0010.04415.04
5.4.240.0030.03915.10
5.4.230.0050.04015.12
5.4.220.0030.02315.15
5.4.210.0060.02514.99
5.4.200.0050.02215.11
5.4.190.0030.02814.99
5.4.180.0030.02315.04
5.4.170.0040.02315.23
5.4.160.0020.02314.94
5.4.150.0080.01815.13
5.4.140.0040.02013.65
5.4.130.0050.01913.90
5.4.120.0060.01813.77
5.4.110.0070.02213.79
5.4.100.0040.03913.77
5.4.90.0040.03713.86
5.4.80.0030.03713.74
5.4.70.0020.02013.80
5.4.60.0050.02013.77
5.4.50.0030.03313.87
5.4.40.0010.02113.83
5.4.30.0030.03913.92
5.4.20.0020.02113.85
5.4.10.0050.02913.73
5.4.00.0040.01913.58
5.3.290.0100.04012.87
5.3.280.0120.03512.76
5.3.270.0000.02512.83
5.3.260.0020.02712.78
5.3.250.0060.01912.83
5.3.240.0040.02412.79
5.3.230.0030.02512.86
5.3.220.0040.01712.76
5.3.210.0060.02112.75
5.3.200.0030.02412.73
5.3.190.0030.03212.74
5.3.180.0100.03812.74
5.3.170.0030.02112.76
5.3.160.0040.02012.80
5.3.150.0040.02812.79
5.3.140.0030.02012.75
5.3.130.0020.03612.75
5.3.120.0030.01912.73
5.3.110.0030.03312.72
5.3.100.0020.02212.48
5.3.90.0050.02812.47
5.3.80.0020.02212.51
5.3.70.0020.02212.48
5.3.60.0050.02012.45
5.3.50.0020.01912.44
5.3.40.0030.02812.46
5.3.30.0050.03812.46
5.3.20.0080.03812.31
5.3.10.0000.02312.31
5.3.00.0080.01612.30
5.2.170.0010.02011.08
5.2.160.0030.02611.08
5.2.150.0090.01411.01
5.2.140.0020.02011.02
5.2.130.0040.02011.04
5.2.120.0030.01611.07
5.2.110.0030.01711.07
5.2.100.0050.01711.03
5.2.90.0030.01611.00
5.2.80.0070.01310.99
5.2.70.0030.01710.96
5.2.60.0030.01811.02
5.2.50.0000.01910.96
5.2.40.0060.01310.97
5.2.30.0000.02110.90
5.2.20.0030.01610.94
5.2.10.0010.01910.91
5.2.00.0030.01510.76
5.1.60.0000.01710.37
5.1.50.0000.01710.51
5.1.40.0020.01110.47
5.1.30.0020.01610.58
5.1.20.0050.02210.68
5.1.10.0040.01310.49
5.1.00.0000.01610.48
5.0.50.0040.0109.78
5.0.40.0000.0129.72
5.0.30.0060.0229.56
5.0.20.0020.0109.61
5.0.10.0010.0119.47
5.0.00.0070.0129.53
4.4.90.0000.0108.98
4.4.80.0020.0088.98
4.4.70.0020.0098.98
4.4.60.0030.0078.98
4.4.50.0000.0118.98
4.4.40.0000.0158.98
4.4.30.0000.0098.98
4.4.20.0030.0118.98
4.4.10.0030.0078.98
4.4.00.0020.0148.98
4.3.110.0000.0118.98
4.3.100.0010.0088.98
4.3.90.0020.0098.98
4.3.80.0020.0218.98
4.3.70.0020.0088.98
4.3.60.0010.0108.98
4.3.50.0000.0098.98
4.3.40.0010.0148.98
4.3.30.0040.0078.98
4.3.20.0000.0108.98
4.3.10.0000.0108.98
4.3.00.0000.0148.98

preferences:
56.81 ms | 401 KiB | 5 Q