3v4l.org

run code in 300+ PHP versions simultaneously
<?php function maskString($string) { return preg_replace('/(?<=.).(?=.*)/u','*',$string); } function maskEmail($email) { $arremail = explode('@',$email); $arrdomain = explode('.',$arremail[1]); $jumdomain = count($arrdomain); echo $jumdomain; $dom = array(); for($i=0; $i<$jumdomain-1; $i++) { $dom[] = maskString($jumdomain[$i]); } $domain = implode('.',$dom); //$email1 = preg_replace('/(?<=.).(?=.*@)/u','*',$arremail[0].'@'); //$email2 = preg_replace('/(?<=.).(?=.*[.])/u','*',$arremail[1]); //return $email1.$email2; return maskString($arremail[0]).'@'.$domain; } $email = 'facebook@yahoo.co.id'; $result = maskEmail($email); echo $result;

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.0070.00718.43
8.3.50.0090.00922.00
8.3.40.0110.00719.07
8.3.30.0090.00919.04
8.3.20.0040.00420.23
8.3.10.0080.00023.34
8.3.00.0070.01319.63
8.2.180.0060.00918.66
8.2.170.0070.00722.96
8.2.160.0080.00620.52
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00419.78
8.2.110.0060.00322.37
8.2.100.0080.00418.03
8.2.90.0060.00318.13
8.2.80.0090.00018.98
8.2.70.0030.00617.75
8.2.60.0050.00317.75
8.2.50.0040.00417.88
8.2.40.0040.00418.00
8.2.30.0080.00018.13
8.2.20.0000.00817.96
8.2.10.0040.00418.23
8.2.00.0070.00018.04
8.1.280.0000.01525.92
8.1.270.0030.00620.73
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.87
8.1.230.0040.00719.22
8.1.220.0040.00417.89
8.1.210.0030.00518.77
8.1.200.0030.00517.48
8.1.190.0030.00617.48
8.1.180.0030.00818.10
8.1.170.0050.00317.62
8.1.160.0000.00722.04
8.1.150.0040.00418.95
8.1.140.0070.00017.68
8.1.130.0070.00017.87
8.1.120.0040.00417.72
8.1.110.0000.00817.68
8.1.100.0000.00717.54
8.1.90.0040.00417.61
8.1.80.0000.00717.67
8.1.70.0030.00317.55
8.1.60.0090.00317.79
8.1.50.0050.00317.79
8.1.40.0050.00317.63
8.1.30.0050.00317.71
8.1.20.0040.00417.83
8.1.10.0040.00417.63
8.1.00.0040.00417.58
8.0.300.0040.00418.77
8.0.290.0000.00717.00
8.0.280.0070.00018.56
8.0.270.0030.00317.28
8.0.260.0000.00717.31
8.0.250.0000.00717.16
8.0.240.0000.00817.29
8.0.230.0030.00317.13
8.0.220.0080.00017.13
8.0.210.0050.00317.21
8.0.200.0030.00317.32
8.0.190.0000.00717.27
8.0.180.0040.00417.24
8.0.170.0000.00817.11
8.0.160.0070.00017.21
8.0.150.0040.00417.04
8.0.140.0030.00317.05
8.0.130.0000.00813.66
8.0.120.0040.00417.14
8.0.110.0000.00817.17
8.0.100.0040.00417.10
8.0.90.0050.00317.05
8.0.80.0100.00717.07
8.0.70.0030.00517.20
8.0.60.0030.00617.19
8.0.50.0060.00317.05
8.0.30.0110.01217.11
8.0.20.0060.01317.40
8.0.10.0000.00817.20
8.0.00.0140.00816.90
7.4.330.0030.00315.18
7.4.320.0000.00716.80
7.4.300.0060.00016.64
7.4.290.0030.00616.81
7.4.280.0040.00416.89
7.4.270.0000.00716.80
7.4.260.0050.00316.84
7.4.250.0050.00316.81
7.4.240.0020.00616.84
7.4.230.0000.00716.68
7.4.220.0130.01616.85
7.4.210.0070.01016.82
7.4.200.0000.00716.89
7.4.160.0030.01216.75
7.4.150.0070.01117.40
7.4.140.0100.01217.86
7.4.130.0130.00816.84
7.4.120.0060.01516.78
7.4.110.0060.01616.67
7.4.100.0160.00716.65
7.4.90.0150.00916.80
7.4.80.0040.01519.39
7.4.70.0130.00416.60
7.4.60.0060.01216.97
7.4.50.0040.00016.87
7.4.40.0120.00416.69
7.4.30.0060.01216.60
7.4.00.0070.00314.97
7.3.330.0000.00513.58
7.3.320.0000.00813.48
7.3.310.0030.00316.60
7.3.300.0030.00316.54
7.3.290.0040.01016.56
7.3.280.0100.00616.61
7.3.270.0090.00917.40
7.3.260.0100.01016.93
7.3.250.0060.01316.68
7.3.240.0120.00616.61
7.3.230.0030.02016.86
7.3.210.0150.00616.72
7.3.200.0090.00919.39
7.3.190.0100.00716.64
7.3.180.0100.00616.49
7.3.170.0100.00616.71
7.3.160.0150.00016.78
7.3.10.0080.01517.03
7.3.00.0140.00416.71
7.2.330.0110.01117.04
7.2.320.0090.00917.00
7.2.310.0040.01216.88
7.2.300.0080.00816.74
7.2.290.0120.00916.95
7.2.130.0140.01716.73
7.2.120.0110.01117.00
7.2.110.0160.00317.07
7.2.100.0140.00716.71
7.2.90.0180.00416.44
7.2.80.0060.01216.83
7.2.70.0140.00316.73
7.2.60.0080.00816.64
7.2.50.0140.00716.76
7.2.40.0150.00616.95
7.2.30.0130.00716.91
7.2.20.0120.00916.71
7.2.10.0120.00816.86
7.2.00.0080.00718.55
7.1.250.0220.00015.61
7.1.100.0040.01118.27
7.1.70.0030.01517.32
7.1.60.0090.01519.32
7.1.50.0150.00634.76
7.1.00.0030.07722.55
7.0.200.0060.00316.83
7.0.140.0030.07721.95
7.0.60.0030.06320.07
7.0.50.0000.04317.83
7.0.40.0100.04020.26
7.0.30.0500.07020.11
7.0.20.0370.03020.25
7.0.10.0170.07720.15
7.0.00.0130.05720.25
5.6.280.0070.07321.02
5.6.210.0030.08320.71
5.6.200.0070.08018.18
5.6.190.0100.03720.61
5.6.180.0230.05320.46
5.6.170.0200.05720.51
5.6.160.0100.05720.56
5.6.150.0030.04318.25
5.6.140.0070.08318.28
5.6.130.0000.04318.14
5.6.120.0070.04321.12
5.6.110.0100.05721.14
5.6.100.0070.04321.12
5.6.90.0100.07721.08
5.6.80.0130.06320.49
5.5.350.0200.03020.41
5.5.340.0000.04717.94
5.5.330.0070.06720.25
5.5.320.0400.07320.38
5.5.310.0270.07720.27
5.5.300.0000.04317.98
5.5.290.0100.06317.95
5.5.280.0100.08720.85
5.5.270.0170.04720.85
5.5.260.0070.08320.87
5.5.250.0070.08020.56
5.5.240.3500.04320.07
5.4.450.0800.06719.18
5.4.440.0770.04319.46
5.4.430.0770.04719.61
5.4.420.0170.04719.69
5.4.410.0730.06319.48
5.4.400.0100.05718.50
5.4.390.0400.05718.78
5.4.380.0330.08018.57
5.4.370.0400.05718.61
5.4.360.0530.04318.79
5.4.350.0330.08018.63
5.4.340.0090.03712.02
5.4.320.0070.03512.51
5.4.310.0080.04412.50
5.4.300.0050.03712.50
5.4.290.0050.04012.50
5.4.280.0050.04112.40
5.4.270.0060.03912.40
5.4.260.0110.03712.40
5.4.250.0130.03912.40
5.4.240.0060.04812.40
5.4.230.0080.03912.39
5.4.220.0060.03612.39
5.4.210.0040.03812.39
5.4.200.0100.04212.39
5.4.190.0090.03412.39
5.4.180.0060.03712.39
5.4.170.0070.03612.39
5.4.160.0070.04012.39
5.4.150.0050.03812.39
5.4.140.0070.03912.07
5.4.130.0100.03512.06
5.4.120.0040.03712.02
5.4.110.0040.03712.02
5.4.100.0060.03512.01
5.4.90.0080.04112.01
5.4.80.0080.03712.01
5.4.70.0050.04012.01
5.4.60.0080.03712.01
5.4.50.0050.03712.00
5.4.40.0070.04212.00
5.4.30.0050.03811.99
5.4.20.0100.03112.00
5.4.10.0050.03611.99
5.4.00.0070.03511.48
5.3.290.0050.04212.80
5.3.280.0040.04012.71
5.3.270.0070.03812.72
5.3.260.0110.03512.72
5.3.250.0100.03412.72
5.3.240.0090.04112.72
5.3.230.0110.03312.71
5.3.220.0060.03612.68
5.3.210.0050.04512.68
5.3.200.0040.03812.68
5.3.190.0050.03912.68
5.3.180.0090.03312.68
5.3.170.0080.03512.67
5.3.160.0060.03612.67
5.3.150.0060.03812.67
5.3.140.0050.03812.66
5.3.130.0140.03212.66
5.3.120.0070.03812.65
5.3.110.0050.04012.66
5.3.100.0100.03312.13
5.3.90.0080.03612.11
5.3.80.0060.04412.10
5.3.70.0050.03712.10
5.3.60.0060.04812.08
5.3.50.0110.03912.03
5.3.40.0080.03412.03
5.3.30.0070.03411.98
5.3.20.0060.03611.77
5.3.10.0100.03211.73
5.3.00.0050.03711.72
5.2.170.0040.0329.23
5.2.160.0060.0289.23
5.2.150.0010.0359.23
5.2.140.0030.0339.22
5.2.130.0030.0309.18
5.2.120.0030.0309.18
5.2.110.0090.0259.19
5.2.100.0070.0269.18
5.2.90.0040.0349.18
5.2.80.0080.0289.18
5.2.70.0080.0339.18
5.2.60.0060.0289.14
5.2.50.0050.0309.10
5.2.40.0060.0379.08
5.2.30.0050.0349.05
5.2.20.0080.0269.05
5.2.10.0060.0328.95
5.2.00.0040.0338.81
5.1.60.0050.0278.09
5.1.50.0030.0268.09
5.1.40.0090.0218.07
5.1.30.0080.0258.42
5.1.20.0050.0268.44
5.1.10.0060.0248.17
5.1.00.0050.0278.16
5.0.50.0030.0216.64
5.0.40.0020.0206.51
5.0.30.0040.0306.32
5.0.20.0030.0206.28
5.0.10.0050.0186.27
5.0.00.0030.0316.26
4.4.90.0040.0154.78
4.4.80.0050.0144.76
4.4.70.0020.0174.75
4.4.60.0030.0154.76
4.4.50.0030.0184.77
4.4.40.0040.0274.71
4.4.30.0020.0164.76
4.4.20.0030.0154.84
4.4.10.0020.0174.84
4.4.00.0050.0254.76
4.3.110.0020.0194.67
4.3.100.0050.0144.67
4.3.90.0050.0124.64
4.3.80.0070.0194.58
4.3.70.0060.0174.63
4.3.60.0010.0164.63
4.3.50.0020.0164.63
4.3.40.0040.0244.54
4.3.30.0020.0163.31
4.3.20.0030.0183.29
4.3.10.0020.0163.25
4.3.00.0200.0236.85

preferences:
41.13 ms | 401 KiB | 5 Q