3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handleCharacterData($parser, $data) { echo __FUNCTION__ . " - " . $data . "\n"; } function handleElementStart($parser, $name, $attributes) { echo __FUNCTION__ . " - " . $name . "\n"; } function handleElementEnd($parser, $name) { echo __FUNCTION__ . " - " . $name . "\n"; } function parseAndOutput($s) { $p = xml_parser_create(); xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, 1); xml_set_character_data_handler($p, 'handleCharacterData'); xml_set_element_handler($p, 'handleElementStart', 'handleElementEnd'); xml_parse_into_struct($p, $s, $values); echo $values[0]['value'] . "\n\n"; } $s = "<a>b\nc</a>"; parseAndOutput($s); $s = "<a>&lt;b&gt;\n&lt;c&gt;</a>"; parseAndOutput($s);
Output for git.master, git.master_jit, rfc.property-hooks
handleElementStart - A handleCharacterData - b c handleElementEnd - A b c handleElementStart - A handleCharacterData - < handleCharacterData - b handleCharacterData - > handleCharacterData - handleCharacterData - < handleCharacterData - c handleCharacterData - > handleElementEnd - A <b> <c>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
107.68 ms | 406 KiB | 5 Q