3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '{ifvar[?]}<tr> <td class="padding-left20 padding-right20" style="padding: 5px 40px 0 40px; background-color: #f8f8f8;"> <span class="size24" style="display: block; font-size: 24px; color: #472786; font-weight: bold; line-height: 1;"> Enjoy our internal messaging system </span> <span class="size14" style="display: block;"> What does it give you? A Casting Professional who is looking to find talent for their projects with AllCasting.com, can initiate a conversation with our members through our easy to use Messaging System. If there\'s a casting call in your area that perfectly matches your profile, you\'ll get notified as well! </span> <span class="size14" style="display: block; padding: 10px 0 0 0;"> You have <span style="font-style: italic; color: #472786; font-weight: bold;"> ? UNREAD message{plural[{GES_UNREAD_CONVERSATIONS}]}s{/plural}</span> from agents and casting directors! </span> <span style="display: block; max-width: 210px; padding: 30px 0 0 0;" class="btnFullWidth size14"> <span class="desktop-btn" style="display: block; text-align: center; padding: 10px 18px 9px 18px; background-color: #2bb672; border-radius: 5px 5px 5px 5px;"> <a href="{GES_SINGLE_LOGIN_URL}&goto=/messages" style="display: block; text-align: center; text-decoration: none; vertical-align: middle; text-transform: uppercase;"> <span style="display: block; font-size: 14px; font-weight: bold; color: #ffffff; line-height: 1.4;">view all messages</span> </a> </span> </span> </td> </tr> <tr> <td style="padding:0;"> <span style="display: block; height: 0; padding: 10px 0 0 0;">&nbsp;</span> </td> </tr> {/ifvar}'; /* echo '<pre style="color:green">'; echo htmlentities($text); echo '</pre>'; */ echo '<pre style="color:red">'; echo htmlentities(_replaceIfVarTags($text)); echo '</pre>'; function _replaceIfVarTags($text) { // $text = iconv("UTF-8", "UTF-8//IGNORE", $text); $regexp = '/\\{!?ifvar\\[(.*?)(?=\\]})\\]\\}(([\\s\\S](?!\\{!?ifvar))*?)\\{\\/ifvar\\}/i'; preg_match_all($regexp, $text, $matches); echo '<hr><pre style="color:black">'; echo htmlentities(print_r($matches,1)); echo '</pre><hr>'; if (!$matches || !$matches[0]) return $text; foreach ($matches[0] as $k => $v) { $value = trim($matches[1][$k]); if (strpos($v, '{!ifvar') === false) { if (in_array($value, ['', '0', 0, false, 'false', null], true)) { $text = str_replace($v, '', $text); } else { $text = str_replace($v, $matches[2][$k], $text); } } else { if ($value === '') { $text = str_replace($v, $matches[2][$k], $text); } else { $text = str_replace($v, '', $text); } } } //return _replaceIfVarTags($text); }

Abusive script

This script was stopped while abusing our resources

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.110.0060.01016.96
8.3.100.0060.00316.89
8.3.90.0080.00026.77
8.3.80.0060.00316.88
8.3.70.0080.00816.75
8.3.60.0130.00318.81
8.3.50.0100.00318.62
8.3.40.0060.01018.99
8.3.30.0150.00019.16
8.3.20.0000.00821.88
8.3.10.0040.00423.48
8.3.00.0000.00823.64
8.2.230.0100.00020.94
8.2.220.0150.00024.06
8.2.210.0000.01326.77
8.2.200.0000.01017.00
8.2.190.0180.00016.63
8.2.180.0130.01025.92
8.2.170.0090.00619.16
8.2.160.0090.00922.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0030.00521.30
8.2.120.0000.00726.35
8.2.110.0030.00620.47
8.2.100.0040.00818.09
8.2.90.0050.00318.22
8.2.80.0000.00918.34
8.2.70.0000.00818.18
8.2.60.0080.00018.05
8.2.50.0080.00018.28
8.2.40.0090.00019.30
8.2.30.0050.00219.34
8.2.20.0030.00618.29
8.2.10.0000.00818.19
8.2.00.0040.00418.23
8.1.290.0030.00630.84
8.1.280.0110.00425.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0050.00528.09
8.1.240.0050.00519.52
8.1.230.0030.01221.16
8.1.220.0060.00317.79
8.1.210.0050.00318.84
8.1.200.0070.00317.60
8.1.190.0050.00317.48
8.1.180.0000.00818.10
8.1.170.0060.00318.78
8.1.160.0040.00419.00
8.1.150.0040.00418.98
8.1.140.0000.00817.81
8.1.130.0070.00019.22
8.1.120.0000.00817.59
8.1.110.0000.00817.58
8.1.100.0050.00317.73
8.1.90.0060.00317.66
8.1.80.0050.00317.71
8.1.70.0000.00817.72
8.1.60.0040.00417.84
8.1.50.0100.00017.77
8.1.40.0040.00417.65
8.1.30.0050.00517.89
8.1.20.0040.00417.98
8.1.10.0000.01117.83
8.1.00.0060.00317.76
8.0.300.0080.00020.11
8.0.290.0000.00717.00
8.0.280.0030.00318.48
8.0.270.0040.00417.30
8.0.260.0030.00317.30
8.0.250.0000.00717.23
8.0.240.0080.00017.13
8.0.230.0050.00517.03
8.0.220.0040.00417.04
8.0.210.0050.00217.11
8.0.200.0070.00017.18
8.0.190.0060.00317.20
8.0.180.0040.00417.17
8.0.170.0040.00417.03
8.0.160.0000.00717.14
8.0.150.0000.01017.12
8.0.140.0020.00516.98
8.0.130.0030.00313.61
8.0.120.0000.00817.07
8.0.110.0000.00717.17
8.0.100.0050.00317.15
8.0.90.0040.00417.09
8.0.80.0060.00917.13
8.0.70.0040.00417.17
8.0.60.0040.00417.02
8.0.50.0080.00017.07
8.0.30.0140.00517.33
8.0.20.0110.00817.40
8.0.10.0050.00217.29
8.0.00.0120.00617.03
7.4.330.0000.00515.55
7.4.320.0030.00316.89
7.4.300.0070.00016.91
7.4.290.0040.00416.91
7.4.280.0040.00416.80
7.4.270.0000.00816.71
7.4.260.0030.00316.78
7.4.250.0050.00216.76
7.4.240.0030.00316.96
7.4.230.0050.00216.90
7.4.220.0040.00416.63
7.4.210.0100.00716.81
7.4.200.0040.00416.99
7.4.160.0090.00816.70
7.4.140.0140.00517.86
7.4.130.0140.00416.63
7.4.120.0100.01016.78
7.4.110.0100.01016.80
7.4.100.0080.00816.94
7.4.90.0130.00316.96
7.4.80.0140.01119.39
7.4.70.0100.01016.75
7.4.60.0060.01016.69
7.4.50.0080.01116.52
7.4.40.0110.00716.91
7.4.10.0080.01215.05
7.4.00.0070.01015.10
7.3.330.0030.00313.32
7.3.320.0000.00613.37
7.3.310.0040.00416.40
7.3.300.0000.00716.43
7.3.290.0040.00416.41
7.3.280.0180.00216.58
7.3.260.0090.00916.60
7.3.240.0110.00916.70
7.3.230.0070.01016.46
7.3.210.0150.00716.54
7.3.200.0090.00916.87
7.3.190.0200.00316.84
7.3.180.0120.00616.59
7.3.170.0070.01116.63
7.3.160.0030.01316.62
7.3.130.0070.01114.93
7.3.120.0100.00814.59
7.3.110.0110.00815.03
7.3.100.0080.00514.79
7.3.90.0100.00314.94
7.3.80.0030.01014.88
7.3.70.0100.00315.09
7.3.60.0040.01214.92
7.3.50.0040.01015.18
7.3.40.0070.00614.65
7.3.30.0030.01115.08
7.3.20.0070.00716.91
7.3.10.0050.00716.87
7.3.00.0090.00516.87
7.2.330.0110.00917.00
7.2.320.0100.00716.85
7.2.310.0090.00917.14
7.2.300.0000.01716.88
7.2.290.0120.00816.90
7.2.260.0090.00915.48
7.2.250.0080.01015.57
7.2.240.0050.01115.43
7.2.230.0030.01415.13
7.2.220.0090.00715.53
7.2.210.0050.00915.21
7.2.200.0120.00315.21
7.2.190.0050.01015.31
7.2.180.0100.00615.21
7.2.170.0080.00815.24
7.2.160.0060.00915.13
7.2.150.0060.00816.95
7.2.140.0050.00617.26
7.2.130.0050.01017.15
7.2.120.0020.01317.18
7.2.110.0050.00917.22
7.2.100.0040.01117.02
7.2.90.0030.01017.19
7.2.80.0050.00817.21
7.2.70.0070.00717.33
7.2.60.0050.01117.05
7.2.50.0070.01017.22
7.2.40.2170.01117.77
7.2.30.1170.01017.80
7.2.20.1020.00717.72
7.2.10.0840.00917.72
7.2.00.1040.00817.85
7.1.330.0090.00715.93
7.1.320.0070.00915.97
7.1.310.0090.00316.04
7.1.300.0080.00815.99
7.1.290.0040.00716.15
7.1.280.0050.00815.96
7.1.270.0090.00615.83
7.1.260.0050.00916.11
7.1.250.0040.01215.98
7.1.240.0050.01116.03
7.1.230.0050.00715.95
7.1.220.0050.00816.03
7.1.210.0050.01015.98
7.1.200.0060.00815.90
7.1.190.0080.00616.07
7.1.180.0050.00916.16
7.1.170.0060.00615.92
7.1.160.2240.01016.71
7.1.150.1990.00816.58
7.1.140.0800.00916.47
7.1.130.1050.01116.66
7.1.120.1230.01016.44
7.1.110.1060.00916.27
7.1.100.1020.00816.30
7.1.90.3020.01116.24
7.1.80.2890.01116.26
7.1.70.2680.00915.88
7.1.60.2880.01224.66
7.1.50.2740.00924.66
7.1.40.3660.01024.43
7.1.30.3940.01224.40
7.1.20.3770.00924.53
7.1.10.2940.00915.44
7.1.00.2060.01115.62
7.0.330.0050.00715.57
7.0.320.0070.00615.67
7.0.310.0040.01015.68
7.0.300.0090.00315.51
7.0.290.0070.00715.58
7.0.280.0070.00515.41
7.0.270.0050.00915.42
7.0.260.0020.00915.47
7.0.250.0050.00815.67
7.0.240.0040.00615.66
7.0.230.0020.01215.65
7.0.220.0070.00515.81
7.0.210.0050.00515.61
7.0.200.0020.01215.56
7.0.190.0020.00815.61
7.0.180.0070.00615.44
7.0.170.0050.01015.63
7.0.160.0080.00515.66
7.0.150.0050.01115.61
7.0.140.0090.00315.62
7.0.130.0060.00415.66
7.0.120.0040.01315.37
7.0.110.0060.01015.30
7.0.100.0040.00615.49
7.0.90.0070.00615.65
7.0.80.0020.01215.57
7.0.70.0080.00715.11
7.0.60.0070.01015.36
7.0.50.0080.00615.38
7.0.40.0040.01013.69
7.0.30.0070.00513.68
7.0.20.0030.00913.51
7.0.10.0020.00913.49
7.0.00.0090.00313.59
5.6.400.0070.01115.91
5.6.390.0090.00516.08
5.6.380.0070.00915.84
5.6.370.0050.01015.82
5.6.360.0060.01015.74
5.6.350.0060.01115.70
5.6.340.0080.01015.69
5.6.330.0050.01015.77
5.6.320.0050.00816.09
5.6.310.0070.00915.50
5.6.300.0030.01015.75
5.6.290.0040.00815.71
5.6.280.0110.00815.81
5.6.270.0020.01515.90
5.6.260.0080.00615.84
5.6.250.0050.00915.74
5.6.240.0030.00915.76
5.6.230.0100.00615.67
5.6.220.0050.01215.69
5.6.210.0060.01015.66
5.6.200.0050.00615.70
5.6.190.0030.01115.70
5.6.180.0100.00515.86
5.6.170.0030.01015.72
5.6.160.0070.00715.83
5.6.150.0070.00815.91
5.6.140.0090.00915.67
5.6.130.0090.00815.68
5.6.120.0030.01215.71
5.6.110.0070.00715.84
5.6.100.0020.01315.78
5.6.90.0080.00515.61
5.6.80.0050.01215.80
5.6.70.0060.00715.63
5.6.60.0050.00815.62
5.6.50.0050.01215.67
5.6.40.0020.01215.67
5.6.30.0050.01215.70
5.6.20.0110.00515.70
5.6.10.0090.00715.66
5.6.00.0020.01215.68

preferences:
72.43 ms | 4045 KiB | 5 Q