3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDescriptionAttribute($string) { $pattern = "~(https?://\S+)|([^\s@]+@[^\s@]+)|(\+\d+)~"; return preg_replace_callback($pattern, function($matches) { $template = '<a href="%1$s%2$s" rel="noopener nofollow" target="_blank">%2$s</a>'; if ($matches[1] !== "") return sprintf($template, "", $matches[1]); if ($matches[2] !== "") return sprintf($template, "mailto:", $matches[2]); if ($matches[3] !== "") return sprintf($template, "tel:", $matches[3]); }, $string); } $str = 'http://google.com tester@gmail.com +1818254545400'; echo getDescriptionAttribute($str);

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.00.0140.00820.29
8.4.150.0020.00014.05
8.4.140.0150.00717.82
8.4.130.0070.00218.70
8.4.120.0130.00723.98
8.4.110.0220.00719.20
8.4.100.0200.00718.07
8.4.90.0190.00718.73
8.4.80.0190.00518.54
8.4.70.0180.00617.77
8.4.60.0180.00718.03
8.4.50.0170.00818.49
8.4.40.0160.00818.23
8.4.30.0190.00419.28
8.4.20.0170.00817.68
8.4.10.0170.00418.29
8.3.280.0090.01018.51
8.3.270.0140.00616.54
8.3.260.0150.00716.88
8.3.250.0080.00818.91
8.3.240.0140.00517.10
8.3.230.0170.00616.41
8.3.220.0170.00616.83
8.3.210.0130.00616.61
8.3.200.0130.00616.50
8.3.190.0150.00416.78
8.3.180.0160.00616.67
8.3.170.0170.00617.25
8.3.160.0180.00317.96
8.3.150.0170.00317.19
8.3.140.0190.00417.23
8.3.130.0150.00517.27
8.3.120.0170.00317.28
8.3.110.0150.00317.85
8.3.100.0180.00419.09
8.3.90.0190.00419.99
8.3.80.0160.00416.80
8.3.70.0160.00816.76
8.3.60.0150.00817.66
8.3.50.0190.00417.49
8.3.40.0140.00418.10
8.3.30.0150.00517.93
8.3.20.0130.00519.81
8.3.10.0110.00520.02
8.3.00.0100.00621.01
8.2.290.0110.00517.93
8.2.280.0170.00617.96
8.2.270.0150.00517.43
8.2.260.0150.00716.68
8.2.250.0170.00516.70
8.2.240.0160.00316.94
8.2.230.0140.00418.54
8.2.220.0130.00423.61
8.2.210.0140.00620.11
8.2.200.0150.00216.70
8.2.190.0140.00516.69
8.2.180.0130.00919.67
8.2.170.0140.00718.19
8.2.160.0160.00419.54
8.2.150.0150.00320.33
8.2.140.0140.00419.84
8.2.130.0150.00320.43
8.2.120.0140.00518.72
8.2.110.0150.00618.23
8.2.100.0180.00417.76
8.2.90.0180.00617.76
8.2.80.0160.00518.23
8.2.70.0130.00617.72
8.2.60.0140.00517.86
8.2.50.0140.00417.83
8.2.40.0150.00318.33
8.2.30.0140.00418.26
8.2.20.0120.00618.66
8.2.10.0150.00317.75
8.2.00.0120.00318.80
8.1.330.0150.00718.01
8.1.320.0140.00716.35
8.1.310.0150.00316.92
8.1.300.0140.00517.37
8.1.290.0150.00517.15
8.1.280.0170.00419.53
8.1.270.0130.00619.55
8.1.260.0180.00620.24
8.1.250.0150.00420.88
8.1.240.0160.00519.52
8.1.230.0130.00518.51
8.1.220.0120.00517.47
8.1.210.0140.00417.84
8.1.200.0110.00617.42
8.1.190.0120.00617.32
8.1.180.0140.00417.62
8.1.170.0100.00617.83
8.1.160.0130.00418.39
8.1.150.0130.00517.93
8.1.140.0110.00517.37
8.1.130.0130.00517.42
8.1.120.0120.00517.36
8.1.110.0150.00317.42
8.1.100.0120.00517.40
8.1.90.0130.00417.47
8.1.80.0130.00317.40
8.1.70.0150.00217.48
8.1.60.0130.00517.67
8.1.50.0120.00617.51
8.1.40.0160.00517.57
8.1.30.0160.00417.61
8.1.20.0120.00517.60
8.1.10.0120.00417.64
8.1.00.0190.00517.57
8.0.300.0160.00617.91
8.0.290.0120.00516.75
8.0.280.0160.00217.33
8.0.270.0120.00516.76
8.0.260.0110.00616.80
8.0.250.0110.00616.77
8.0.240.0140.00117.50
8.0.230.0140.00317.15
8.0.220.0110.00516.61
8.0.210.0130.00417.36
8.0.200.0150.00216.69
8.0.190.0140.00417.36
8.0.180.0130.00516.82
8.0.170.0180.00317.27
8.0.160.0130.00516.91
8.0.150.0220.00316.83
8.0.140.0130.00517.30
8.0.130.0190.00516.73
8.0.120.0180.00416.69
8.0.110.0160.00616.57
8.0.100.0160.00516.65
8.0.90.0170.00517.27
8.0.80.0150.00716.79
8.0.70.0190.00516.52
8.0.60.0170.00316.86
8.0.50.0150.00616.64
8.0.30.0190.00316.73
8.0.20.0140.00616.78
8.0.10.0150.00616.84
8.0.00.0170.00416.98
7.4.330.0100.00416.22
7.4.320.0120.00416.49
7.4.300.0120.00316.57
7.4.290.0110.00516.58
7.4.280.0130.00316.58
7.4.270.0140.00316.42
7.4.260.0200.00516.39
7.4.250.0170.00616.58
7.4.240.0170.00416.55
7.4.230.0170.00416.45
7.4.220.0200.00416.45
7.4.210.0160.00617.09
7.4.200.0140.00617.26
7.4.190.0160.00416.55
7.4.180.0180.00316.57
7.4.160.0160.00416.61
7.4.150.0160.00416.63
7.4.140.0150.00416.46
7.4.130.0140.00716.97
7.4.120.0170.00416.46
7.4.110.0150.00616.49
7.4.100.0150.00516.65
7.4.90.0150.00416.48
7.4.80.0160.00416.63
7.4.70.0170.00616.56
7.4.60.0190.00216.46
7.4.50.0190.00216.43
7.4.40.0160.00416.44
7.4.30.0170.00316.40
7.4.20.0160.00516.49
7.4.10.0160.00516.94
7.4.00.0180.00117.05
7.3.330.0150.00516.15
7.3.320.0160.00316.22
7.3.310.0160.00416.25
7.3.300.0150.00516.25
7.3.290.0180.00316.18
7.3.280.0130.00716.28
7.3.270.0140.00516.19
7.3.260.0180.00316.20
7.3.250.0180.00316.12
7.3.240.0200.00416.09
7.3.230.0200.00316.00
7.3.220.0190.00416.17
7.3.210.0160.00516.18
7.3.200.0180.00316.14
7.3.190.0140.00616.30
7.3.180.0160.00516.17
7.3.170.0160.00316.44
7.3.160.0150.00616.69
7.3.150.0130.00616.14
7.3.140.0170.00316.11
7.3.130.0160.00416.09

preferences:
31.55 ms | 403 KiB | 5 Q