3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('PINGTAGS', [ '#' => 'hashtag.php?hashtag', '@' => 'user.php?user' ]); function convert_text($str) { return preg_replace_callback( "~(?i)\bhttps?[-\w.\~:/?#[\]@!$&'()*+,;=]+|[@#](\w+)|U\+([A-F\d]{5})~", function($m) { // var_export($m); // see for yourself if (!isset($m[1])) { return sprintf('<a href="%s">%s</a>', $m[0], $m[0]); } if (!isset($m[2])) { return sprintf('<a href="%s=%s">%s</a>', PINGTAGS[$m[0][0]], $m[1], $m[0]); } return "<span class=\"emoji\">&#x{$m[2]};</span>"; }, $str); } echo convert_text( <<<STRING This is a @ping and a #hash. This is a www.example.com, this is http://example.com?asdf=1234#anchor https://www.example.net/a/b/c/?g=5&awesome=foobar# U+23232 http://www5.example.com https://sub.sub.www.example.org/ @pong@pug#tagged http://example.com/@dave more http://example.com/more_(than)_one_(parens) andU+98765more http://example.com/blah_(wikipedia)#cite-1 and more http://example.com/blah_(wikipedia)_blah#cite-1 and more http://example.com/(something)?after=parens STRING );

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.4.140.0130.00817.55
8.4.130.0130.00918.22
8.4.120.0130.01020.10
8.4.110.0110.00922.31
8.4.100.0150.00718.07
8.4.90.0070.00320.64
8.4.80.0130.00818.27
8.4.70.0070.00419.99
8.4.60.0100.01019.19
8.4.50.0050.00717.95
8.4.40.0090.00019.43
8.4.30.0100.01018.58
8.4.20.0070.00418.87
8.4.10.0060.00317.76
8.3.270.0120.00916.58
8.3.260.0120.00916.88
8.3.250.0100.00819.07
8.3.240.0050.00518.62
8.3.230.0100.00616.67
8.3.220.0110.00917.25
8.3.210.0110.00816.75
8.3.200.0060.00216.80
8.3.190.0040.00417.20
8.3.180.0090.00916.74
8.3.170.0030.01618.64
8.3.160.0150.00017.16
8.3.150.0120.00617.13
8.3.140.0130.00619.10
8.3.130.0060.00318.41
8.3.120.0100.00020.86
8.3.110.0100.00020.94
8.3.100.0100.00017.13
8.3.90.0000.00818.62
8.3.80.0060.00316.88
8.3.70.0090.00618.43
8.3.60.0140.01018.43
8.3.50.0150.00518.39
8.3.40.0120.00319.08
8.3.30.0070.00719.01
8.3.20.0080.00022.66
8.3.10.0070.00020.34
8.3.00.0080.00023.51
8.2.290.0130.00616.98
8.2.280.0070.00820.46
8.2.270.0110.00719.02
8.2.260.0040.00416.87
8.2.250.0040.00418.67
8.2.240.0040.00419.02
8.2.230.0060.00922.58
8.2.220.0040.00424.06
8.2.210.0000.00826.77
8.2.200.0060.00317.00
8.2.190.0070.01416.88
8.2.180.0100.00618.66
8.2.170.0140.00718.91
8.2.160.0070.00722.96
8.2.150.0000.00824.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0060.00320.55
8.2.100.0060.00617.87
8.2.90.0040.00417.75
8.2.80.0060.00318.88
8.2.70.0030.00617.75
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0040.00418.29
8.2.30.0040.00418.29
8.2.20.0040.00418.23
8.2.10.0070.00019.31
8.2.00.0040.00419.40
8.1.330.0120.00622.18
8.1.320.0090.00616.14
8.1.310.0070.00318.45
8.1.300.0040.00417.88
8.1.290.0050.00518.88
8.1.280.0040.01425.92
8.1.270.0080.00020.64
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00018.92
8.1.230.0120.00017.96
8.1.220.0040.00417.79
8.1.210.0060.00318.77
8.1.200.0040.00417.38
8.1.190.0030.00617.38
8.1.180.0040.00418.10
8.1.170.0080.00318.78
8.1.160.0000.00819.01
8.1.150.0040.00418.98
8.1.140.0070.00021.06
8.1.130.0030.00320.18
8.1.120.0040.00417.65
8.1.110.0000.00917.57
8.1.100.0000.00817.57
8.1.90.0000.00717.54
8.1.80.0000.00717.64
8.1.70.0060.00317.59
8.1.60.0050.00317.67
8.1.50.0060.00317.52
8.1.40.0000.00817.52
8.1.30.0080.00017.70
8.1.20.0030.00617.73
8.1.10.0040.00417.72
8.1.00.0040.00417.57
8.0.300.0000.00818.77
8.0.290.0060.00316.88
8.0.280.0040.00418.43
8.0.270.0000.00717.25
8.0.260.0050.00320.11
8.0.250.0020.00517.02
8.0.240.0000.00717.01
8.0.230.0090.00017.08
8.0.220.0000.00717.04
8.0.210.0030.00617.01
8.0.200.0000.00717.12
8.0.190.0050.00217.12
8.0.180.0080.00017.07
8.0.170.0030.00617.09
8.0.160.0070.00017.02
8.0.150.0000.00716.98
8.0.140.0000.00816.95
8.0.130.0030.00313.43
8.0.120.0040.00417.02
8.0.110.0080.00017.03
8.0.100.0000.00817.03
8.0.90.0050.00317.01
8.0.80.0110.00617.03
8.0.70.0040.00417.08
8.0.60.0050.00317.18
8.0.50.0060.00317.09
8.0.30.0100.00717.39
8.0.20.0080.01017.22
8.0.10.0070.00017.29
8.0.00.0110.00917.02
7.4.330.0050.00016.73
7.4.320.0040.00416.63
7.4.300.0000.00616.70
7.4.290.0110.00316.86
7.4.280.0070.00416.81
7.4.270.0000.00716.79
7.4.260.0030.00313.51
7.4.250.0050.00316.79
7.4.240.0000.00916.81
7.4.230.0050.00316.91
7.4.220.0030.00316.73
7.4.210.0080.00816.74
7.4.200.0080.00016.87
7.4.130.0060.01216.79
7.4.120.0110.01116.60
7.4.110.0040.01416.83
7.4.100.0070.01316.67
7.4.90.0140.00416.77
7.4.80.0060.01019.39
7.4.70.0100.00716.71
7.4.60.0090.00616.81
7.4.50.0110.00416.77
7.4.40.0100.01416.64
7.4.00.0050.01215.21
7.3.330.0000.00716.65
7.3.320.0000.00613.54
7.3.310.0050.00216.60
7.3.300.0040.00416.51
7.3.290.0030.00316.66
7.3.280.0100.01016.63
7.3.260.0110.00816.67
7.3.230.0140.00316.56
7.3.210.0060.01116.75
7.3.200.0120.00916.61
7.3.190.0140.00816.78
7.3.180.0090.00916.67
7.3.170.0070.01416.70
7.3.160.0000.02216.72
7.3.120.0040.00915.27
7.3.110.0040.00815.27
7.3.100.0040.01514.86
7.3.90.0090.00615.09
7.3.80.0060.00615.05
7.3.70.0070.00814.98
7.3.60.0040.01115.04
7.3.50.0110.00514.92
7.3.40.0090.00615.02
7.3.30.0070.00914.91
7.3.20.0080.01116.65
7.3.10.0120.00516.65
7.3.00.0070.00816.81
7.2.330.0130.00316.97
7.2.320.0140.00316.83
7.2.310.0100.00716.78
7.2.300.0100.00716.78
7.2.290.0060.01216.96
7.2.250.0060.01315.30
7.2.240.0100.00015.25
7.2.230.0070.01315.10
7.2.220.0040.00715.25
7.2.210.0030.01215.16
7.2.200.0060.00715.21
7.2.190.0050.01315.27
7.2.180.0090.00815.18
7.2.170.0030.01115.33
7.2.160.0030.00915.33
7.2.150.0110.00317.05
7.2.140.0040.01116.94
7.2.130.0080.00317.36
7.2.120.0110.00416.98
7.2.110.0080.00416.89
7.2.100.0130.00317.19
7.2.90.0060.00917.09
7.2.80.0060.00917.13
7.2.70.0110.00316.94
7.2.60.0090.00617.04
7.2.50.0040.01417.32
7.2.40.0060.01217.02
7.2.30.0040.00817.28
7.2.20.0060.00917.02
7.2.10.0100.00717.10
7.2.00.0060.01017.19
7.1.330.0070.00715.91
7.1.320.0080.00315.96
7.1.310.0050.00615.97
7.1.300.0070.00415.89
7.1.290.0070.00815.89
7.1.280.0080.00315.91
7.1.270.0040.00616.01
7.1.260.0070.00715.87
7.1.250.0060.00615.84

preferences:
30.25 ms | 403 KiB | 5 Q