3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $strXML = '<?xml version="1.0" encoding="utf-8"?><List><Item PackageID="PID1197131022103218421" PackageName="2013冬季不冷-徽章碎片“季”" LotteryLevel="5" LotteryLevelName="2013冬季不冷-徽章碎片“季”" LotteryScale="0.25" /><Item PackageID="PID1197131022102238558" PackageName="2013冬季不冷-徽章碎片"2013"" LotteryLevel="1" LotteryLevelName="2013冬季不冷-徽章碎片"2013"" LotteryScale="0.24" /><Item PackageID="PID1197131022102721419" PackageName="2013冬季不冷-徽章碎片“温”" LotteryLevel="2" LotteryLevelName="2013冬季不冷-徽章碎片“温”" LotteryScale="0.26" /><Item PackageID="PID1197131022102820466" PackageName="2013冬季不冷-徽章碎片“暖”" LotteryLevel="3" LotteryLevelName="2013冬季不冷-徽章碎片“暖”" LotteryScale="0.0001" /><Item PackageID="PID1197131022102940279" PackageName="2013冬季不冷-徽章碎片“冬”" LotteryLevel="4" LotteryLevelName="2013冬季不冷-徽章碎片“冬”" LotteryScale="0.2499" /></List>'; $strXML = preg_replace_callback( '|="[^=]*"|', function ($matches) { return substr($matches[0], 0, 2) . htmlspecialchars(substr($matches[0], 2, -1)) . substr($matches[0], -1); }, $strXML ); echo $strXML; $xml = simplexml_load_string($strXML);
Output for 5.3.0 - 7.1.0
<?xml version="1.0" encoding="utf-8"?><List><Item PackageID="PID1197131022103218421" PackageName="2013冬季不冷-徽章碎片“季”" LotteryLevel="5" LotteryLevelName="2013冬季不冷-徽章碎片“季”" LotteryScale="0.25" /><Item PackageID="PID1197131022102238558" PackageName="2013冬季不冷-徽章碎片&quot;2013&quot;" LotteryLevel="1" LotteryLevelName="2013冬季不冷-徽章碎片&quot;2013&quot;" LotteryScale="0.24" /><Item PackageID="PID1197131022102721419" PackageName="2013冬季不冷-徽章碎片“温”" LotteryLevel="2" LotteryLevelName="2013冬季不冷-徽章碎片“温”" LotteryScale="0.26" /><Item PackageID="PID1197131022102820466" PackageName="2013冬季不冷-徽章碎片“暖”" LotteryLevel="3" LotteryLevelName="2013冬季不冷-徽章碎片“暖”" LotteryScale="0.0001" /><Item PackageID="PID1197131022102940279" PackageName="2013冬季不冷-徽章碎片“冬”" LotteryLevel="4" LotteryLevelName="2013冬季不冷-徽章碎片“冬”" LotteryScale="0.2499" /></List>
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/YP7VS on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/YP7VS on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/YP7VS on line 5
Process exited with code 255.