3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8" ?> <note> <to> <form>pswA</form> <heading>A</heading> </to> <to> <form>pswB</form> <heading>A</heading> </to> </note>'; $xml = simplexml_load_string($data); foreach ($xml->to as $to){ if ($to->form == 'pswA' && $to->heading == 'A'){echo "allow";} elseif ($to->form == 'pswA' && $to->heading == 'B'){echo "notallow";} elseif ($to->form == 'pswA' && $to->heading == 'C'){echo "block";} } foreach ($xml->to as $to){ if ($to->form == 'pswC' && $to->heading == 'A'){echo "allow";} elseif ($to->form == 'pswC' && $to->heading == 'B'){echo "notallow";} elseif ($to->form == 'pswC' && $to->heading == 'C'){echo "block";} } ?>
Output for git.master, git.master_jit, rfc.property-hooks
allow

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:
36.61 ms | 405 KiB | 5 Q