3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_shortcode_regex( $tagnames = null ) { global $shortcode_tags; if ( empty( $tagnames ) ) { $tagnames = array_keys( $shortcode_tags ); } $tagregexp = join( '|', array_map('preg_quote', $tagnames) ); // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag() // Also, see shortcode_unautop() and shortcode.js. return '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . "($tagregexp)" // 2: Shortcode name . '(?![\\w-])' // Not followed by word character or hyphen . '(' // 3: Unroll the loop: Inside the opening shortcode tag . '[^\\]\\/]*' // Not a closing bracket or forward slash . '(?:' . '\\/(?!\\])' // A forward slash not followed by a closing bracket . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')*?' . ')' . '(?:' . '(\\/)' // 4: Self closing tag ... . '\\]' // ... and closing bracket . '|' . '\\]' // Closing bracket . '(?:' . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags . '[^\\[]*+' // Not an opening bracket . '(?:' . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag . '[^\\[]*+' // Not an opening bracket . ')*+' . ')' . '\\[\\/\\2\\]' // Closing shortcode tag . ')?' . ')' . '(\\]?)'; // 6: Optional second closing brocket for escaping shortcodes: [[tag]] } function shortcode_parse_atts($text) { $atts = array(); $pattern = get_shortcode_atts_regex(['audio']); $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) { foreach ($match as $m) { if (!empty($m[1])) $atts[strtolower($m[1])] = stripcslashes($m[2]); elseif (!empty($m[3])) $atts[strtolower($m[3])] = stripcslashes($m[4]); elseif (!empty($m[5])) $atts[strtolower($m[5])] = stripcslashes($m[6]); elseif (isset($m[7]) && strlen($m[7])) $atts[] = stripcslashes($m[7]); elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } // Reject any unclosed HTML elements foreach( $atts as &$value ) { if ( false !== strpos( $value, '<' ) ) { if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) { $value = ''; } } } } else { $atts = ltrim($text); } return $atts; } var_dump(shortcode_parse_atts(':http://localhost:8888/lusa/audio/1310seg02.mp3'));

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.0150.00016.73
8.3.50.0070.01321.14
8.3.40.0090.00618.82
8.3.30.0110.00418.79
8.3.20.0040.00420.20
8.3.10.0040.00421.77
8.3.00.0000.00823.70
8.2.180.0080.00818.29
8.2.170.0040.01122.96
8.2.160.0130.00720.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00021.11
8.2.120.0040.00426.35
8.2.110.0090.00019.23
8.2.100.0060.00617.90
8.2.90.0050.00519.17
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0000.00918.04
8.2.50.0030.00518.09
8.2.40.0080.00022.28
8.2.30.0000.00719.27
8.2.20.0000.00717.64
8.2.10.0000.00818.14
8.2.00.0030.00618.04
8.1.280.0070.01125.92
8.1.270.0150.00422.06
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0080.00417.23
8.1.230.0080.00417.70
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00617.25
8.1.190.0030.00517.35
8.1.180.0080.00018.10
8.1.170.0080.00018.35
8.1.160.0070.00020.73
8.1.150.0110.00018.76
8.1.140.0080.00019.54
8.1.130.0030.00317.66
8.1.120.0000.00717.45
8.1.110.0000.00817.42
8.1.100.0030.00517.32
8.1.90.0040.00417.46
8.1.80.0060.00617.41
8.1.70.0070.00017.47
8.1.60.0000.00717.53
8.1.50.0030.00617.45
8.1.40.0000.00817.54
8.1.30.0040.00417.68
8.1.20.0040.00417.60
8.1.10.0000.00817.66
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0030.00318.46
8.0.270.0040.00417.11
8.0.260.0030.00317.20
8.0.250.0060.00016.87
8.0.240.0030.00317.00
8.0.230.0000.00717.00
8.0.220.0000.00716.87
8.0.210.0000.00716.91
8.0.200.0060.00017.00
8.0.190.0040.00417.00
8.0.180.0030.00516.88
8.0.170.0000.00717.00
8.0.160.0040.00416.94
8.0.150.0000.00816.96
8.0.140.0070.00016.87
8.0.130.0070.00013.38
8.0.120.0040.00416.78
8.0.110.0040.00416.92
8.0.100.0000.00716.96
8.0.90.0080.00016.81
8.0.80.0060.00916.87
8.0.70.0040.00416.70
8.0.60.0050.00316.79
8.0.50.0000.00716.91
8.0.30.0090.00717.18
8.0.20.0080.01317.40
8.0.10.0070.00017.00
8.0.00.0050.01416.77
7.4.330.0020.00216.79
7.4.320.0030.00316.59
7.4.300.0030.00316.63
7.4.290.0090.00016.58
7.4.280.0060.00316.38
7.4.270.0030.00416.55
7.4.260.0040.00416.62
7.4.250.0040.00416.51
7.4.240.0080.00016.54
7.4.230.0040.00416.52
7.4.220.0030.01616.50
7.4.210.0100.01016.71
7.4.200.0030.00316.73
7.4.160.0080.00816.55
7.4.150.0120.00617.40
7.4.140.0090.01217.86
7.4.130.0050.01216.58
7.4.120.0070.00916.67
7.4.110.0040.01516.59
7.4.100.0070.01016.54
7.4.90.0130.00316.57
7.4.80.0110.00719.39
7.4.70.0130.00316.54
7.4.60.0140.00316.44
7.4.50.0040.01116.44
7.4.40.0030.01316.59
7.4.30.0130.00716.35
7.4.00.0040.01114.67
7.3.330.0080.00013.33
7.3.320.0070.00013.15
7.3.310.0000.00716.33
7.3.300.0000.00716.26
7.3.290.0110.00616.32
7.3.280.0080.01016.34
7.3.270.0000.01917.40
7.3.260.0060.01216.29
7.3.250.0120.00516.40
7.3.240.0090.00916.37
7.3.230.0090.01216.55
7.3.210.0040.01216.52
7.3.200.0180.00019.39
7.3.190.0070.01016.58
7.3.180.0100.00816.30
7.3.170.0060.00716.61
7.3.160.0000.01616.35
7.2.330.0140.00516.41
7.2.320.0090.00916.30
7.2.310.0040.01316.59
7.2.300.0070.01816.66
7.2.290.0160.00016.57
7.2.80.0090.00316.70
7.2.60.0070.00316.78
7.2.00.0060.00919.28
7.1.200.0070.01015.61
7.1.100.0070.00417.76
7.1.70.0030.00716.73
7.1.60.0070.01119.40
7.1.50.0030.01016.61
7.1.00.0100.07022.48
7.0.200.0220.00414.44
7.0.60.0130.08721.82
7.0.50.0030.04017.87
7.0.40.0030.08320.11
7.0.30.0230.03720.21
7.0.20.0230.07320.24
7.0.10.0130.06020.20
7.0.00.0070.04720.06
5.6.280.0000.06721.15
5.6.210.0230.08020.74
5.6.200.0030.04018.18
5.6.190.0030.09020.57
5.6.180.0300.07020.50
5.6.170.0330.08720.39
5.6.160.0070.08020.57
5.6.150.0000.08318.22
5.6.140.0030.04318.15
5.6.130.0030.04018.24
5.6.120.0170.07321.03
5.6.110.0130.07721.11
5.6.100.0130.05021.16
5.6.90.0030.07020.99
5.6.80.0100.07320.39
5.5.350.0330.07320.43
5.5.340.0070.08017.96
5.5.330.0170.04320.47
5.5.320.0100.04720.27
5.5.310.0330.08020.34
5.5.300.0030.08718.04
5.5.290.0130.07718.01
5.5.280.0000.04720.98
5.5.270.0070.04720.69
5.5.260.0070.05020.91
5.5.250.0000.05320.63
5.5.240.0230.03020.28

preferences:
58.1 ms | 401 KiB | 5 Q