3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xmlWriter = new XMLWriter(); $xmlWriter->openMemory(); $xmlWriter->writeRaw("<text>Нажмите 1 для переадресации на колл-центр</text>"); $xmlWriter->writeRaw("<silence>0.5</silence>"); $xmlWriter->writeRaw("<text>нажмите 2 для получения информации о скидках</text>"); $xmlWriter->writeRaw("<silence>0.5</silence>"); $xmlWriter->writeRaw("<text>нажмите 3 чтобы оставить сообщение</text>"); $xmlWriter->startElement("dtmf"); $xmlWriter->writeAttribute("wait", "10"); $xmlWriter->writeRaw("<key value=\"1\"><redirect>+7123321</redirect></key>"); $xmlWriter->writeRaw("<key value=\"2\"><audio>http://www.yoursite.ru/sound.ogg</audio></key>"); $xmlWriter->writeRaw('<key value=\"3\"><record length="10" name="record1" submit="http://www.yoursite.ru/record_submit.php"></record></key>'); $xmlWriter->endElement(); echo $xmlWriter->outputMemory();
based on jGQKC
Output for 5.2.0 - 7.2.0
<text>Нажмите 1 для переадресации на колл-центр</text><silence>0.5</silence><text>нажмите 2 для получения информации о скидках</text><silence>0.5</silence><text>нажмите 3 чтобы оставить сообщение</text><dtmf wait="10"><key value="1"><redirect>+7123321</redirect></key><key value="2"><audio>http://www.yoursite.ru/sound.ogg</audio></key><key value=\"3\"><record length="10" name="record1" submit="http://www.yoursite.ru/record_submit.php"></record></key></dtmf>
Output for 5.1.2 - 5.1.6
Fatal error: Call to undefined method XMLWriter::writeRaw() in /in/YB80j on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.1
Fatal error: Class 'XMLWriter' not found in /in/YB80j on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: xmlwriter in /in/YB80j on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: xmlwriter in /in/YB80j on line 3