3v4l.org

run code in 300+ PHP versions simultaneously
<?php $commentString = "His phone is not functional because the camera does not appear/work and he needs it to be usable for Cerity. It also freezes up. He's had his last phone for 3 years, it's time for an upgrade. Thank you!"; $comments = array(); $labels = array( 'Comment Type:' => 'type', 'Comment Body:' => 'body', 'Comment By:' => 'by', 'Comment Date:' => 'date' ); $commentParts = explode('Comment Type:', $commentsString); foreach ($commentParts as $commentPart) { $comment = array(); $commentLines = explode("\n", $commentPart); array_walk($commentLines, create_function('&$val', '$val = trim($val);')); $currentLabel = 'unknown'; foreach ($commentLines as $line) { if (empty($line)) continue; if (empty($comment['type'])) { $comment['type'] = $line; continue; } if (substr($line, 0, 5) == 'Body:') { $line = substr($line, 5); $currentLabel = 'body'; } if (in_array($line, array_keys($labels))) { $currentLabel = $labels[$line]; $comment[$currentLabel] = ''; } else { if (empty($comment[$currentLabel])) $comment[$currentLabel] = ''; $comment[$currentLabel] .= $line . ' '; } } if (!empty($comment)) $comments[] = $comment; } var_dump($comments);

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.0130.00318.81
8.3.60.0120.00318.68
8.3.50.0120.00921.98
8.3.40.0040.01118.94
8.3.30.0100.00319.04
8.3.20.0080.00020.20
8.3.10.0030.00520.71
8.3.00.0030.00619.68
8.2.180.0130.01016.63
8.2.170.0060.01022.96
8.2.160.0130.00020.52
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.14
8.2.110.0040.00422.26
8.2.100.0040.00719.77
8.2.90.0000.00819.13
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0060.00318.05
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0040.00419.29
8.2.20.0050.00317.68
8.2.10.0000.00818.15
8.2.00.0030.00517.77
8.1.280.0040.01125.92
8.1.270.0040.00422.14
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00323.87
8.1.230.0040.00719.09
8.1.220.0030.00517.79
8.1.210.0080.00018.77
8.1.200.0030.00717.35
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0040.00418.52
8.1.160.0040.00422.05
8.1.150.0050.00218.97
8.1.140.0000.00817.37
8.1.130.0070.00017.83
8.1.120.0000.00717.43
8.1.110.0070.00017.45
8.1.100.0040.00417.43
8.1.90.0040.00417.46
8.1.80.0000.00717.54
8.1.70.0040.00417.48
8.1.60.0040.00417.62
8.1.50.0060.00317.57
8.1.40.0040.00417.41
8.1.30.0040.00417.60
8.1.20.0070.00017.63
8.1.10.0050.00217.50
8.1.00.0060.00617.44
8.0.300.0000.00718.77
8.0.290.0090.00016.75
8.0.280.0040.00418.55
8.0.270.0000.00817.20
8.0.260.0040.00417.17
8.0.250.0030.00317.00
8.0.240.0070.00017.05
8.0.230.0050.00316.97
8.0.220.0000.00716.99
8.0.210.0000.00716.89
8.0.200.0040.00417.05
8.0.190.0030.00317.13
8.0.180.0040.00417.08
8.0.170.0040.00416.97
8.0.160.0000.00716.97
8.0.150.0030.00316.83
8.0.140.0000.00716.96
8.0.130.0030.00313.36
8.0.120.0080.00016.98
8.0.110.0020.00517.00
8.0.100.0000.00716.78
8.0.90.0040.00316.87
8.0.80.0130.01016.95
8.0.70.0000.00717.00
8.0.60.0000.00716.83
8.0.50.0050.00217.00
8.0.30.0120.00916.91
8.0.20.0130.00917.43
8.0.10.0050.00317.14
8.0.00.0070.01116.74
7.4.330.0020.00315.13
7.4.320.0030.00316.51
7.4.300.0000.00716.65
7.4.290.0040.00416.54
7.4.280.0040.00716.73
7.4.270.0000.00716.69
7.4.260.0000.00716.53
7.4.250.0040.00416.55
7.4.240.0000.00716.66
7.4.230.0070.00016.46
7.4.220.0110.00716.64
7.4.210.0030.01216.61
7.4.200.0040.00416.75
7.4.160.0070.01016.51
7.4.150.0200.00617.40
7.4.140.0080.01517.86
7.4.130.0070.01016.56
7.4.120.0090.01016.57
7.4.110.0090.00616.56
7.4.100.0100.00716.58
7.4.90.0080.00816.53
7.4.80.0030.01316.65
7.4.70.0060.01016.68
7.4.60.0030.01416.56
7.4.50.0050.00016.70
7.4.40.0140.00416.54
7.4.30.0110.00516.60
7.4.10.0100.01014.72
7.4.00.0060.00814.96
7.3.330.0000.00613.25
7.3.320.0070.00013.25
7.3.310.0030.00516.35
7.3.300.0030.00316.31
7.3.290.0070.01016.37
7.3.280.0060.01116.39
7.3.270.0110.00717.40
7.3.260.0080.00816.35
7.3.250.0100.01016.46
7.3.240.0100.00716.41
7.3.230.0130.00316.41
7.3.210.0120.00916.44
7.3.200.0060.01219.39
7.3.190.0030.01316.34
7.3.180.0080.00916.47
7.3.170.0130.00616.58
7.3.160.0140.00416.51
7.3.130.0090.00614.80
7.3.120.0070.01014.75
7.3.110.0080.01014.94
7.3.100.0050.00914.85
7.3.90.0050.00614.79
7.3.80.0040.01114.91
7.3.70.0090.00314.91
7.3.60.0020.01014.93
7.3.50.0080.00714.96
7.3.40.0050.01114.86
7.3.30.0070.00714.82
7.3.20.0080.00616.72
7.3.10.0080.00516.79
7.3.00.0030.00816.56
7.2.330.0060.01216.61
7.2.320.0140.00616.80
7.2.310.0080.00816.73
7.2.300.0060.01816.74
7.2.290.0030.01816.65
7.2.260.0090.00314.93
7.2.250.0110.00615.03
7.2.240.0060.01115.17
7.2.230.0060.01115.20
7.2.220.0080.00815.08
7.2.210.0080.00514.89
7.2.200.0100.00514.92
7.2.190.0050.00815.19
7.2.180.0060.00915.20
7.2.170.0040.01114.98
7.2.160.0090.00915.21
7.2.150.0110.00416.94
7.2.140.0110.00416.75
7.2.130.0070.00716.61
7.2.120.0130.00017.02
7.2.110.0110.00316.87
7.2.100.0030.00616.82
7.2.90.0090.00616.96
7.2.80.0030.00816.79
7.2.70.0080.00817.05
7.2.60.0030.00716.79
7.2.50.0040.01117.04
7.2.40.0040.01117.04
7.2.30.0140.00317.05
7.2.20.0060.01016.77
7.2.10.0070.00716.93
7.2.00.0080.00418.11
7.1.330.0080.00615.68
7.1.320.0050.01015.65
7.1.310.0030.00915.61
7.1.300.0060.00815.78
7.1.290.0020.00915.78
7.1.280.0080.00715.63
7.1.270.0050.01115.75
7.1.260.0080.00715.70
7.1.250.0090.00615.55
7.1.240.0030.01015.86
7.1.230.0080.01215.72
7.1.220.0030.00715.83
7.1.210.0030.01015.71
7.1.200.0060.00715.71
7.1.190.0080.00815.94
7.1.180.0080.00615.67
7.1.170.0030.00915.58
7.1.160.0100.00015.65
7.1.150.0000.01215.79
7.1.140.0100.00315.80
7.1.130.0070.00715.84
7.1.120.0070.00715.72
7.1.110.0110.00415.54
7.1.100.0020.01116.76
7.1.90.0030.00715.88
7.1.80.0030.01415.51
7.1.70.0040.00816.40
7.1.60.0050.01417.44
7.1.50.0150.01025.30
7.1.40.0080.00615.78
7.1.30.0070.00715.55
7.1.20.0040.01115.67
7.1.10.0090.00315.66
7.1.00.0050.04319.18
7.0.330.0030.00915.32
7.0.320.0110.00715.18
7.0.310.0050.00515.13
7.0.300.0050.00515.56
7.0.290.0070.00715.24
7.0.280.0040.01115.43
7.0.270.0070.00715.54
7.0.260.0040.00815.50
7.0.250.0030.00915.25
7.0.240.0030.01415.22
7.0.230.0030.01015.19
7.0.220.0130.00315.66
7.0.210.0000.00915.16
7.0.200.0060.00416.08
7.0.190.0030.00615.13
7.0.180.0030.01315.20
7.0.170.0090.00615.50
7.0.160.0040.01215.43
7.0.150.0040.01115.58
7.0.140.0070.03918.82
7.0.130.0030.01015.45
7.0.120.0060.00615.34
7.0.110.0030.01015.53
7.0.100.0090.00315.37
7.0.90.0030.01415.38
7.0.80.0030.00615.46
7.0.70.0070.01115.54
7.0.60.0020.03517.76
7.0.50.0120.03916.66
7.0.40.0040.02416.90
7.0.30.0220.03916.88
7.0.20.0200.04016.93
7.0.10.0090.03916.81
7.0.00.0070.04016.95
5.6.400.0060.00913.92
5.6.390.0070.00313.81
5.6.380.0050.00514.43
5.6.370.0090.00614.36
5.6.360.0080.00414.06
5.6.350.0000.00914.33
5.6.340.0000.01814.41
5.6.330.0100.00314.46
5.6.320.0030.00914.52
5.6.310.0030.00614.49
5.6.300.0090.00614.09
5.6.290.0040.00714.07
5.6.280.0060.03917.60
5.6.270.0060.00614.20
5.6.260.0030.01313.90
5.6.250.0060.00914.39
5.6.240.0080.00514.31
5.6.230.0090.00914.23
5.6.220.0110.00814.40
5.6.210.0100.03817.38
5.6.200.0100.02216.21
5.6.190.0070.02217.29
5.6.180.0220.04717.45
5.6.170.0160.02817.38
5.6.160.0080.04317.48
5.6.150.0070.02216.13
5.6.140.0050.04216.16
5.6.130.0050.02416.17
5.6.120.0050.04517.69
5.6.110.0060.04617.71
5.6.100.0050.05017.67
5.6.90.0120.03817.62
5.6.80.0090.03917.31
5.6.70.2330.02217.32
5.6.60.0110.00014.54
5.6.50.0060.00314.03
5.6.40.0090.00014.27
5.6.30.0070.00714.18
5.6.20.0030.01314.34
5.6.10.0030.01214.11
5.6.00.0040.00714.21
5.5.380.0000.01014.35
5.5.370.0000.01414.25
5.5.360.0070.01014.21
5.5.350.0100.03917.20
5.5.340.0050.02516.10
5.5.330.0030.02917.30
5.5.320.0200.04417.30
5.5.310.0160.02717.25
5.5.300.0030.02316.13
5.5.290.0070.03916.19
5.5.280.0030.03117.35
5.5.270.0070.04217.43
5.5.260.0040.02517.45
5.5.250.0060.02117.38
5.5.240.0120.04417.18
5.5.230.0030.01114.17
5.5.220.0030.01014.06
5.5.210.0000.01613.96
5.5.200.0070.00414.29
5.5.190.0060.00913.93
5.5.180.0000.01214.08
5.5.170.0040.00714.21
5.5.160.0060.01014.28
5.5.150.0070.00713.95
5.5.140.0030.00914.06
5.5.130.0140.00014.14
5.5.120.0030.00613.96
5.5.110.0000.01013.82
5.5.100.0040.00414.05
5.5.90.0130.00314.21
5.5.80.0030.00614.28
5.5.70.0100.00314.12
5.5.60.0070.01013.96
5.5.50.0000.00914.21
5.5.40.0060.00314.06
5.5.30.0090.00314.25
5.5.20.0000.01514.21
5.5.10.0060.00314.05
5.5.00.0030.00914.30
5.4.450.0210.03315.33
5.4.440.0470.03215.51
5.4.430.0080.03515.23
5.4.420.0200.03315.08
5.4.410.0080.03415.16
5.4.400.0330.03115.19
5.4.390.0380.04415.04
5.4.380.0080.03614.79
5.4.370.0210.04314.85
5.4.360.0180.03514.72
5.4.350.0180.03514.92
5.4.340.0270.03614.89
5.4.330.0040.00710.74
5.4.320.0060.02011.81
5.4.310.0010.02611.74
5.4.300.0060.01911.72
5.4.290.0050.02211.59
5.4.280.0050.02111.55
5.4.270.0070.02111.79
5.4.260.0050.02411.61
5.4.250.0070.02111.70
5.4.240.0060.02011.80
5.4.230.0050.02111.68
5.4.220.0030.02211.51
5.4.210.0050.02111.79
5.4.200.0030.02211.64
5.4.190.0080.01911.66
5.4.180.0060.02211.67
5.4.170.0060.02111.73
5.4.160.0060.02011.65
5.4.150.0070.02111.59
5.4.140.0040.02111.55
5.4.130.0080.02111.67
5.4.120.0030.02211.39
5.4.110.0030.02011.36
5.4.100.0050.02011.38
5.4.90.0060.02011.53
5.4.80.0040.02511.54
5.4.70.0040.02111.53
5.4.60.0050.01911.39
5.4.50.0040.02111.49
5.4.40.0060.01911.51
5.4.30.0030.02311.37
5.4.20.0070.02311.43
5.4.10.0050.02011.28
5.4.00.0070.02011.21
5.3.290.0030.04312.80
5.3.280.0040.03812.71
5.3.270.0050.03812.73
5.3.260.0050.04412.72
5.3.250.0060.03812.72
5.3.240.0070.03412.72
5.3.230.0050.03712.70
5.3.220.0080.03812.68
5.3.210.0080.05112.68
5.3.200.0060.03612.68
5.3.190.0060.03912.68
5.3.180.0070.03412.67
5.3.170.0070.04112.67
5.3.160.0050.03512.67
5.3.150.0080.03412.68
5.3.140.0070.04212.66
5.3.130.0100.03912.66
5.3.120.0070.03912.66
5.3.110.0080.03512.66
5.3.100.0050.04112.13
5.3.90.0040.03812.11
5.3.80.0040.03812.11
5.3.70.0040.04412.11
5.3.60.0000.04312.10
5.3.50.0090.03312.04
5.3.40.0030.04412.04
5.3.30.0130.03912.00
5.3.20.0060.03411.77
5.3.10.0040.03511.74
5.3.00.0080.04811.73
5.2.170.0070.0369.23
5.2.160.0060.0279.24
5.2.150.0020.0329.24
5.2.140.0060.0419.23
5.2.130.0040.0289.19
5.2.120.0050.0319.20
5.2.110.0070.0279.20
5.2.100.0060.0289.19
5.2.90.0030.0319.20
5.2.80.0050.0299.19
5.2.70.0040.0319.19
5.2.60.0030.0319.15
5.2.50.0070.0279.12
5.2.40.0070.0269.10
5.2.30.0040.0299.06
5.2.20.0010.0319.05
5.2.10.0020.0308.96
5.2.00.0050.0308.82
5.1.60.0050.0238.11
5.1.50.0030.0258.10
5.1.40.0040.0248.08
5.1.30.0070.0328.44
5.1.20.0040.0268.45
5.1.10.0020.0288.18
5.1.00.0040.0258.18
5.0.50.0030.0206.66
5.0.40.0050.0176.52
5.0.30.0010.0336.33
5.0.20.0030.0196.30
5.0.10.0020.0216.28
5.0.00.0030.0326.27
4.4.90.0020.0164.78
4.4.80.0020.0154.75
4.4.70.0060.0114.76
4.4.60.0020.0164.76
4.4.50.0020.0164.77
4.4.40.0040.0244.70
4.4.30.0050.0134.75
4.4.20.0020.0164.84
4.4.10.0030.0154.84
4.4.00.0020.0264.76
4.3.110.0040.0144.67
4.3.100.0030.0154.67
4.3.90.0040.0134.63
4.3.80.0020.0254.58
4.3.70.0020.0154.63
4.3.60.0040.0134.63
4.3.50.0050.0194.63
4.3.40.0030.0234.54
4.3.30.0030.0153.33
4.3.20.0000.0183.30
4.3.10.0050.0193.27
4.3.00.0070.0236.73

preferences:
40.16 ms | 401 KiB | 5 Q