3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo <<<HEREDOC TEST HEREDOC; // Because you are presumably rtrim()ing the input, if the last statement in the file is a heredoc/nowdoc // it results in a syntax error, because the trailing lf is part of the terminator. This comment will make // it work. Just do $input = rtrim($input) . "\n"; to fix. Strictly you should keep the trailing line break // anyway because of https://stackoverflow.com/a/729795/889949

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.5.30.0120.00620.51
8.5.20.0100.00719.68
8.5.10.0120.00616.68
8.5.00.0120.01019.56
8.4.180.0120.00925.74
8.4.170.0110.01123.78
8.4.160.0180.00623.93
8.4.150.0090.00616.77
8.4.140.0120.00817.34
8.4.130.0050.00317.53
8.4.120.0100.01020.53
8.4.110.0070.00218.60
8.4.100.0140.00618.94
8.4.90.0070.00420.51
8.4.80.0050.00318.79
8.4.70.0090.00718.74
8.4.60.0120.00820.45
8.4.50.0150.00620.21
8.4.40.0060.00319.23
8.4.30.0080.00017.59
8.4.20.0130.00719.41
8.4.10.0060.01019.42
8.3.300.0120.00820.76
8.3.290.0130.00720.84
8.3.280.0090.01018.32
8.3.270.0080.01216.58
8.3.260.0110.00716.64
8.3.250.0080.01018.98
8.3.240.0130.00616.60
8.3.230.0110.00716.27
8.3.220.0130.00518.83
8.3.210.0090.00516.41
8.3.200.0060.00216.61
8.3.190.0070.00416.84
8.3.180.0130.00518.84
8.3.170.0030.00516.48
8.3.160.0180.00017.11
8.3.150.0140.00418.73
8.3.140.0000.01820.64
8.3.130.0080.00018.25
8.3.120.0070.00318.70
8.3.110.0040.00720.94
8.3.100.0080.00424.06
8.3.90.0140.00726.77
8.3.80.0040.00417.97
8.3.70.0130.00918.15
8.3.60.0110.00718.23
8.3.50.0080.00616.36
8.3.40.0040.01118.75
8.3.30.0070.00718.59
8.3.20.0000.00720.25
8.3.10.0080.00023.72
8.3.00.0080.00019.38
8.2.300.0130.00718.57
8.2.290.0090.00218.72
8.2.280.0120.00818.35
8.2.270.0150.00316.74
8.2.260.0090.00616.38
8.2.250.0040.00418.17
8.2.240.0030.00617.00
8.2.230.0000.00922.58
8.2.220.0000.00937.54
8.2.210.0080.00626.77
8.2.200.0040.00818.02
8.2.190.0040.01116.58
8.2.180.0070.01318.41
8.2.170.0000.01422.96
8.2.160.0030.01020.28
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00019.33
8.2.120.0040.00426.35
8.2.110.0000.00920.31
8.2.100.0110.00017.59
8.2.90.0030.00617.50
8.2.80.0080.00018.79
8.2.70.0030.00517.93
8.2.60.0050.00317.91
8.2.50.0000.00818.10
8.2.40.0040.00420.42
8.2.30.0000.00819.22
8.2.20.0000.00718.03
8.2.10.0040.00417.93
8.2.00.0000.00718.12
8.1.340.0130.00621.56
8.1.330.0100.01117.98
8.1.320.0130.00615.89
8.1.310.0040.00416.72
8.1.300.0060.00318.26
8.1.290.0060.00630.84
8.1.280.0160.00325.92
8.1.270.0050.00320.00
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00318.83
8.1.230.0090.00317.64
8.1.220.0080.00017.74
8.1.210.0050.00518.77
8.1.200.0030.00517.10
8.1.190.0000.00917.10
8.1.180.0000.00818.10
8.1.170.0050.00318.56
8.1.160.0040.00418.66
8.1.150.0040.00418.79
8.1.140.0000.00719.11
8.1.130.0070.00018.98
8.1.120.0040.00417.25
8.1.110.0000.00817.33
8.1.100.0000.00717.34
8.1.90.0040.00417.22
8.1.80.0000.00917.37
8.1.70.0000.00817.17
8.1.60.0070.00317.35
8.1.50.0020.00517.26
8.1.40.0000.00817.30
8.1.30.0000.00817.35
8.1.20.0040.00417.55
8.1.10.0040.00417.42
8.1.00.0040.00417.30
8.0.300.0070.00018.93
8.0.290.0000.00816.75
8.0.280.0030.00618.38
8.0.270.0040.00417.18
8.0.260.0030.00317.12
8.0.250.0000.00716.85
8.0.240.0040.00416.93
8.0.230.0030.00316.77
8.0.220.0030.00316.82
8.0.210.0000.00716.79
8.0.200.0000.00616.77
8.0.190.0000.00816.91
8.0.180.0040.00416.84
8.0.170.0040.00416.80
8.0.160.0000.00716.87
8.0.150.0000.00716.76
8.0.140.0080.00016.79
8.0.130.0000.00513.29
8.0.120.0030.00616.66
8.0.110.0070.00016.77
8.0.100.0040.00416.72
8.0.90.0040.00416.86
8.0.80.0080.00816.74
8.0.70.0000.00816.70
8.0.60.0040.00416.86
8.0.50.0040.00416.68
8.0.30.0100.00716.91
8.0.20.0100.01017.40
8.0.10.0030.00316.76
8.0.00.0080.01016.65
7.4.330.0000.00515.55
7.4.320.0030.00316.37
7.4.300.0060.00016.41
7.4.290.0050.00216.43
7.4.280.0040.00416.36
7.4.270.0000.00716.29
7.4.260.0060.00016.37
7.4.250.0070.00016.43
7.4.240.0030.00316.28
7.4.230.0000.00716.41
7.4.220.0070.00016.56
7.4.210.0060.00816.33
7.4.200.0000.00616.16
7.4.160.0100.00716.32
7.4.150.0120.00617.40
7.4.140.0110.01117.86
7.4.130.0060.01216.43
7.4.120.0140.00916.40
7.4.110.0150.00316.35
7.4.100.0120.00816.31
7.4.90.0120.00616.49
7.4.80.0080.01219.39
7.4.70.0110.00616.37
7.4.60.0040.01116.21
7.4.50.0060.00916.35
7.4.40.0080.00816.31
7.4.00.0030.01315.07
7.3.330.0000.00513.18
7.3.320.0000.00613.18
7.3.310.0080.00016.15
7.3.300.0030.00316.19
7.3.290.0030.01216.20
7.3.280.0100.00716.20
7.3.270.0070.01317.40
7.3.260.0080.01216.22
7.3.250.0100.00816.31
7.3.240.0140.00716.40
7.3.230.0080.00816.30
7.3.210.0120.00416.29
7.3.200.0110.00516.27
7.3.190.0060.01016.34
7.3.180.0080.00816.27
7.3.170.0070.01016.18
7.3.160.0090.00616.21
7.2.330.0090.01216.30
7.2.320.0060.01616.53
7.2.310.0030.01316.62
7.2.300.0100.01016.39
7.2.290.0140.00716.48
7.2.60.0080.00716.53
7.2.10.0090.01219.49
7.2.00.0100.01019.32
7.1.200.0060.00615.26
7.1.130.0060.01318.46
7.1.120.0030.01318.58
7.1.110.0030.01518.10
7.1.100.0130.00017.70
7.1.90.0040.00918.09
7.1.80.0030.01718.02
7.1.70.0060.01517.03
7.1.60.0160.01634.96
7.1.50.0210.01834.73
7.1.40.0210.01734.32
7.1.30.0160.01934.38
7.1.20.0220.00634.32
7.1.10.0110.00416.42
7.1.00.0000.01516.41

preferences:
103.46 ms | 1371 KiB | 5 Q