3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT {swal title:='<span style="font-size: 16px;">INFORMATION</span>',html:='<span style="font-size: 14px;">Mask and sanitary pass are</span><b><span style="font-size: 14px; color: #FF0000;"> mandatory for all adults and kids from 12 to 17 to....</span></b><br /><br /><b>Thanks!</b>',icon:='info',confirmButtonText:='OK',iconColor:='#FF0000'}{/swal} TEXT; echo preg_replace_callback( "~^{swal |\G(?!^)(?:(,?[a-z]+:=')(.*?)(')|}{/swal}(*SKIP))~mi", function($m) { return count($m) === 4 ? $m[1] . htmlentities($m[2]) . $m[3] : $m[0]; }, $text );
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
{swal title:='&lt;span style=&quot;font-size: 16px;&quot;&gt;INFORMATION&lt;/span&gt;',html:='&lt;span style=&quot;font-size: 14px;&quot;&gt;Mask and sanitary pass are&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 14px; color: #FF0000;&quot;&gt; mandatory for all adults and kids from 12 to 17 to....&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thanks!&lt;/b&gt;',icon:='info',confirmButtonText:='OK',iconColor:='#FF0000'}{/swal}
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 {swal title:='&lt;span style=&quot;font-size: 16px;&quot;&gt;INFORMATION&lt;/span&gt;',html:='&lt;span style=&quot;font-size: 14px;&quot;&gt;Mask and sanitary pass are&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 14px; color: #FF0000;&quot;&gt; mandatory for all adults and kids from 12 to 17 to....&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Thanks!&lt;/b&gt;',icon:='info',confirmButtonText:='OK',iconColor:='#FF0000'}{/swal}

preferences:
131.12 ms | 402 KiB | 155 Q