3v4l.org

run code in 300+ PHP versions simultaneously
<?php $answer['message'] = "this is a test message. next is emptyline and here are to empty lines end."; print(preg_replace("/^$/ui", "", str_replace(["\n\r", "\n\n", "\r\r","\r\n"], "\n", $answer['message'])));

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.00316.63
8.3.50.0180.00222.95
8.3.40.0070.00718.95
8.3.30.0030.01219.04
8.3.20.0060.00320.39
8.3.10.0140.00323.57
8.3.00.0040.00419.51
8.2.180.0090.00916.63
8.2.170.0030.01322.96
8.2.160.0000.01420.53
8.2.150.0040.00424.18
8.2.140.0100.00024.66
8.2.130.0150.00026.16
8.2.120.0000.00821.28
8.2.110.0000.00922.38
8.2.100.0040.00718.03
8.2.90.0040.00419.39
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0040.00418.05
8.2.50.0000.00818.07
8.2.40.0030.00519.96
8.2.30.0000.00718.09
8.2.20.0000.00817.95
8.2.10.0060.00318.14
8.2.00.0000.00817.76
8.1.280.0090.00625.92
8.1.270.0050.00322.00
8.1.260.0070.00026.35
8.1.250.0020.00528.09
8.1.240.0060.00323.96
8.1.230.0110.00019.15
8.1.220.0040.00817.91
8.1.210.0030.00618.77
8.1.200.0050.00517.48
8.1.190.0040.00417.36
8.1.180.0040.00418.10
8.1.170.0030.00818.64
8.1.160.0000.00721.96
8.1.150.0000.00718.78
8.1.140.0000.00817.46
8.1.130.0030.00317.79
8.1.120.0030.00517.55
8.1.110.0000.00817.47
8.1.100.0070.00017.48
8.1.90.0000.00717.35
8.1.80.0040.00417.48
8.1.70.0000.00717.39
8.1.60.0060.00317.55
8.1.50.0080.00017.43
8.1.40.0040.00417.52
8.1.30.0000.00817.69
8.1.20.0000.00817.60
8.1.10.0040.00417.54
8.1.00.0040.00417.47
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0000.00718.26
8.0.270.0000.00717.21
8.0.260.0000.00617.20
8.0.250.0030.00317.00
8.0.240.0030.00317.08
8.0.230.0040.00416.91
8.0.220.0030.00416.92
8.0.210.0070.00016.94
8.0.200.0060.00017.00
8.0.190.0040.00416.92
8.0.180.0040.00417.03
8.0.170.0050.00317.05
8.0.160.0070.00017.05
8.0.150.0070.00016.92
8.0.140.0000.00716.82
8.0.130.0030.00313.40
8.0.120.0090.00016.86
8.0.110.0000.00816.95
8.0.100.0040.00417.00
8.0.90.0070.00016.84
8.0.80.0090.00616.95
8.0.70.0040.00416.96
8.0.60.0080.00016.94
8.0.50.0050.00316.96
8.0.30.0060.01217.20
8.0.20.0110.01317.40
8.0.10.0040.00416.88
8.0.00.0120.00816.95
7.4.330.0050.00015.00
7.4.320.0060.00016.71
7.4.300.0030.00316.64
7.4.290.0030.00316.79
7.4.280.0040.00416.54
7.4.270.0030.00316.65
7.4.260.0090.00016.63
7.4.250.0040.00416.70
7.4.240.0030.00316.76
7.4.230.0040.00216.82
7.4.220.0070.01116.66
7.4.210.0060.01316.64
7.4.200.0030.00316.75
7.4.160.0120.00816.50
7.4.150.0070.01117.40
7.4.140.0080.01017.86
7.4.130.0070.01116.76
7.4.120.0100.00616.78
7.4.110.0070.01016.64
7.4.100.0030.01316.48
7.4.90.0060.01316.70
7.4.80.0100.00719.39
7.4.70.0090.01316.72
7.4.60.0110.00716.75
7.4.50.0050.00316.74
7.4.40.0160.00016.68
7.4.30.0060.00916.58
7.4.00.0100.00715.26
7.3.330.0060.00013.29
7.3.320.0060.00013.24
7.3.310.0000.00716.42
7.3.300.0030.00316.32
7.3.290.0090.00516.46
7.3.280.0060.01016.47
7.3.270.0140.00917.40
7.3.260.0130.01016.50
7.3.250.0120.00416.76
7.3.240.0070.01416.39
7.3.230.0120.00616.50
7.3.210.0110.00716.63
7.3.200.0080.00819.39
7.3.190.0120.00616.71
7.3.180.0060.01016.78
7.3.170.0030.01416.41
7.3.160.0040.01416.72
7.3.10.0040.01116.67
7.3.00.0030.00616.93
7.2.330.0090.00916.90
7.2.320.0120.00616.86
7.2.310.0090.00916.79
7.2.300.0030.01416.55
7.2.290.0060.00916.81
7.2.130.0060.00916.87
7.2.120.0070.00717.20
7.2.110.0040.00817.10
7.2.100.0110.00017.05
7.2.90.0000.00917.37
7.2.80.0090.00617.02
7.2.70.0040.00816.81
7.2.60.0040.01117.22
7.2.50.0070.00716.96
7.2.40.0090.00317.12
7.2.30.0040.00717.27
7.2.20.0070.00716.73
7.2.10.0070.00416.77
7.2.00.0030.00616.97
7.1.250.0000.00915.93
7.1.70.0090.00317.34
7.1.60.0110.01419.40
7.1.50.0060.01617.09
7.1.00.0030.07722.29
7.0.200.0340.01214.50
7.0.140.0030.07322.08
7.0.60.0070.07320.02
7.0.50.0100.05717.86
7.0.40.0030.04320.06
7.0.30.0530.07320.04
7.0.20.0230.08020.14
7.0.10.0170.06020.03
7.0.00.0070.06320.19
5.6.280.0000.07720.92
5.6.210.0100.07720.46
5.6.200.0070.08018.13
5.6.190.0030.08320.37
5.6.180.3530.03720.41
5.6.170.0230.04020.49
5.6.160.0200.05020.33
5.6.150.0030.08318.18
5.6.140.0100.08018.19
5.6.130.0100.08018.18
5.6.120.0030.04320.89
5.6.110.0100.06720.88
5.6.100.0130.07020.97
5.6.90.0170.06720.98
5.6.80.0130.07320.43
5.6.70.4270.04020.47
5.5.350.0370.06720.32
5.5.340.0130.06017.92
5.5.330.0070.08720.43
5.5.320.0330.04020.30
5.5.310.0230.03720.16
5.5.300.0000.04317.91
5.5.290.0070.03717.99
5.5.280.0230.04720.86
5.5.270.0130.07320.87
5.5.260.0170.07320.64
5.5.250.0070.07320.46
5.5.240.0230.07020.07
5.4.450.0170.06019.66
5.4.440.0200.04719.42
5.4.430.0100.05319.52
5.4.420.0000.06319.16
5.4.410.0130.05318.81
5.4.400.0300.07718.50
5.4.390.0200.05718.46
5.4.380.0100.05018.72
5.4.370.0100.05318.48
5.4.360.0130.04718.66
5.4.350.0110.04711.97
5.4.340.0050.03811.96
5.4.320.0060.03612.45
5.4.310.0040.04112.45
5.4.300.0080.03812.45
5.4.290.0050.03812.45
5.4.280.0080.03912.35
5.4.270.0030.03812.34
5.4.260.0040.04012.34
5.4.250.0060.03612.35
5.4.240.0040.03712.35
5.4.230.0040.03912.34
5.4.220.0030.04512.34
5.4.210.0050.03812.34
5.4.200.0080.04012.34
5.4.190.0070.03912.34
5.4.180.0080.03812.34
5.4.170.0040.04012.35
5.4.160.0030.03812.34
5.4.150.0100.03612.34
5.4.140.0050.03712.02
5.4.130.0040.03712.01
5.4.120.0060.03711.96
5.4.110.0070.03811.96
5.4.100.0070.03311.96
5.4.90.0060.04311.96
5.4.80.0050.04111.96
5.4.70.0070.03611.96
5.4.60.0070.03711.96
5.4.50.0080.04211.96
5.4.40.0060.04211.95
5.4.30.0060.03511.95
5.4.20.0040.03811.95
5.4.10.0090.03911.95
5.4.00.0070.03511.43
5.3.290.0120.04212.80
5.3.280.0090.03812.71
5.3.270.0100.03512.72
5.3.260.0050.04012.72
5.3.250.0060.04412.72
5.3.240.0040.03912.71
5.3.230.0060.03612.71
5.3.220.0050.03812.68
5.3.210.0050.04612.68
5.3.200.0050.03712.68
5.3.190.0070.03812.68
5.3.180.0020.04512.67
5.3.170.0100.03212.67
5.3.160.0110.03812.67
5.3.150.0030.04012.67
5.3.140.0050.04012.66
5.3.130.0070.03612.66
5.3.120.0120.03512.66
5.3.110.0040.04412.65
5.3.100.0050.03912.12
5.3.90.0100.04112.09
5.3.80.0070.04012.07
5.3.70.0070.03412.07
5.3.60.0080.04112.07
5.3.50.0090.04512.00
5.3.40.0040.03812.00
5.3.30.0080.03311.95
5.3.20.0050.03511.73
5.3.10.0080.04311.70
5.3.00.0080.03711.69
5.2.170.0060.0309.18
5.2.160.0050.0369.18
5.2.150.0060.0299.18
5.2.140.0050.0319.18
5.2.130.0050.0309.14
5.2.120.0070.0269.14
5.2.110.0080.0339.14
5.2.100.0040.0369.14
5.2.90.0050.0329.14
5.2.80.0070.0329.13
5.2.70.0030.0359.14
5.2.60.0040.0319.09
5.2.50.0040.0319.06
5.2.40.0030.0309.04
5.2.30.0040.0299.01
5.2.20.0070.0269.00
5.2.10.0050.0278.92
5.2.00.0060.0278.78
5.1.60.0060.0248.07
5.1.50.0050.0238.07
5.1.40.0050.0228.04
5.1.30.0050.0308.40
5.1.20.0050.0258.42
5.1.10.0060.0278.15
5.1.00.0040.0298.14
5.0.50.0050.0226.63
5.0.40.0030.0266.48
5.0.30.0020.0336.29
5.0.20.0040.0256.27
5.0.10.0010.0236.24
5.0.00.0030.0306.23
4.4.90.0030.0144.78
4.4.80.0040.0194.75
4.4.70.0030.0174.75
4.4.60.0040.0144.75
4.4.50.0040.0144.77
4.4.40.0020.0254.70
4.4.30.0040.0184.76
4.4.20.0040.0174.85
4.4.10.0020.0164.85
4.4.00.0020.0254.76
4.3.110.0000.0204.66
4.3.100.0030.0194.66
4.3.90.0030.0154.63
4.3.80.0030.0284.59
4.3.70.0030.0194.63
4.3.60.0010.0164.63
4.3.50.0050.0204.63
4.3.40.0040.0224.53
4.3.30.0020.0233.29
4.3.20.0030.0153.26
4.3.10.0030.0223.22
4.3.00.0230.0237.29

preferences:
39.68 ms | 401 KiB | 5 Q