3v4l.org

run code in 300+ PHP versions simultaneously
<?php $grid_id_unique_name = 'vc_gid'; $pattern = getShortcodeRegexForId(); var_dump($pattern[10]); $content = '[hello]'; preg_match_all( "/$pattern/", $content, $found ); function getShortcodeRegexForId() { return '\\[' // Opening bracket . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]] . '([\\w-_]+)' // 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 . ')*?' . '(?:' . '(' . 'vic_gid' // 4: GridId must exist . '[^\\]\\/]*' // Not a closing bracket or forward slash . ')+' . ')' . ')' . '(?:' . '(\\/)' // 5: Self closing tag ... . '\\]' // ... and closing bracket . '|' . '\\]' // Closing bracket . '(?:' . '(' // 6: 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 . ')?' . ')' . '(\\]?)'; // 7: Optional second closing brocket for escaping shortcodes: [[tag]] }

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.70.0060.00916.75
8.3.60.0140.00716.88
8.3.50.0080.00816.38
8.3.40.0170.00321.98
8.3.30.0120.00318.72
8.3.20.0080.00024.18
8.3.10.0050.00324.66
8.3.00.0070.00026.16
8.2.190.0090.00616.58
8.2.180.0090.00925.92
8.2.170.0000.01518.79
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00426.35
8.2.110.0070.00422.20
8.2.100.0110.00017.84
8.2.90.0040.00418.03
8.2.80.0050.00317.97
8.2.70.0050.00317.62
8.2.60.0000.00818.02
8.2.50.0000.00918.10
8.2.40.0060.00320.50
8.2.30.0070.00018.18
8.2.20.0000.00718.08
8.2.10.0070.00019.44
8.2.00.0040.00419.38
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0080.00028.09
8.1.250.0000.00828.09
8.1.240.0070.01022.06
8.1.230.0090.00320.86
8.1.220.0040.00417.79
8.1.210.0030.00519.03
8.1.200.0090.00017.13
8.1.190.0060.00317.23
8.1.180.0030.00618.10
8.1.170.0040.00418.53
8.1.160.0040.00418.87
8.1.150.0040.00418.86
8.1.140.0080.00018.92
8.1.130.0030.00517.41
8.1.120.0050.00317.44
8.1.110.0040.00417.34
8.1.100.0040.00417.42
8.1.90.0030.00717.34
8.1.80.0040.00417.42
8.1.70.0000.00717.44
8.1.60.0030.00617.68
8.1.50.0090.00017.47
8.1.40.0000.00817.58
8.1.30.0000.00917.67
8.1.20.0040.00417.63
8.1.10.0000.00817.51
8.1.00.0040.00417.60
8.0.300.0040.00420.07
8.0.290.0070.00016.75
8.0.280.0050.00318.54
8.0.270.0070.00018.16
8.0.260.0030.00316.93
8.0.250.0030.00317.10
8.0.240.0030.00317.01
8.0.230.0060.00317.00
8.0.220.0030.00317.00
8.0.210.0000.00717.01
8.0.200.0060.00016.99
8.0.190.0070.00017.08
8.0.180.0000.00717.09
8.0.170.0040.00417.07
8.0.160.0080.00017.09
8.0.150.0000.00816.96
8.0.140.0000.00716.88
8.0.130.0000.00513.52
8.0.120.0080.00017.06
8.0.110.0070.00016.98
8.0.100.0070.00016.88
8.0.90.0000.00716.89
8.0.80.0050.01316.97
8.0.70.0040.00417.04
8.0.60.0000.00716.98
8.0.50.0000.00716.82
8.0.30.0110.00617.38
8.0.20.0130.00917.22
8.0.10.0000.00717.04
8.0.00.0120.01216.66
7.4.330.0000.00515.55
7.4.320.0030.00316.45
7.4.300.0100.00016.52
7.4.290.0050.00216.69
7.4.280.0000.00816.57
7.4.270.0030.00316.71
7.4.260.0000.00513.43
7.4.250.0030.00316.55
7.4.240.0000.00716.55
7.4.230.0000.00716.61
7.4.220.0020.00516.68
7.4.210.0050.01316.69
7.4.200.0030.00316.41
7.4.130.0040.01616.60
7.4.120.0030.01616.77
7.4.110.0120.00516.63
7.4.100.0080.00916.59
7.4.90.0070.01016.64
7.4.80.0070.01316.56
7.4.70.0090.01016.57
7.4.60.0100.00916.66
7.4.50.0110.01116.53
7.4.40.0110.01016.60
7.4.30.0120.00716.46
7.4.20.0100.01016.62
7.4.10.0100.00916.60
7.4.00.0150.00616.53
7.3.330.0000.00716.38
7.3.320.0000.00613.38
7.3.310.0000.00716.35
7.3.300.0070.00016.41
7.3.290.0050.01116.45
7.3.260.0100.01116.40
7.3.240.0070.01016.56
7.3.230.0080.01116.58
7.3.220.0100.00716.59
7.3.210.0080.00816.58
7.3.200.0090.00816.63
7.3.190.0120.00816.31
7.3.180.0110.01016.44
7.3.170.0130.01016.44
7.3.160.0120.00916.50
7.3.150.0060.01116.48
7.3.140.0050.01216.53
7.3.130.0140.00616.47
7.3.120.0110.01016.57
7.3.110.0050.01216.52
7.3.100.0120.00616.52
7.3.90.0080.01116.55
7.3.80.0120.00716.46
7.3.70.0070.01116.46
7.3.60.0120.00716.48
7.3.50.0100.01016.50
7.3.40.0090.00816.45
7.3.30.0100.00816.50
7.3.20.0140.00716.50
7.3.10.0090.01016.39
7.3.00.0080.01016.50
7.2.340.0120.00516.80
7.2.330.0060.01616.87
7.2.320.0100.01116.82
7.2.310.0100.01016.75
7.2.300.0070.01316.77
7.2.290.0100.01016.86
7.2.280.0140.00616.95
7.2.270.0090.01316.88
7.2.260.0150.00416.65
7.2.250.0090.00916.76
7.2.240.0110.00916.95
7.2.230.0100.01016.83
7.2.220.0120.00716.84
7.2.210.0100.00916.85
7.2.200.0090.01016.74
7.2.190.0090.01216.67
7.2.180.0080.01016.64
7.2.170.0070.01016.84
7.2.160.0130.00616.65
7.2.150.0090.01116.81
7.2.140.0210.00816.77
7.2.130.0090.01316.81
7.2.120.0090.00916.82
7.2.110.0090.00816.84
7.2.100.0120.00716.84
7.2.90.0160.00916.93
7.2.80.0120.00716.86
7.2.70.0090.00916.75
7.2.60.0120.00616.84
7.2.50.0060.01416.85
7.2.40.0070.01316.82
7.2.30.0120.00716.86
7.2.20.0060.01316.83
7.2.10.0120.01016.83
7.2.00.0120.00816.68

preferences:
39.62 ms | 401 KiB | 5 Q