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";} } ob_start(); 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"; } if(!ob_get_contents()) echo "empty"; ob_end_flush(); ?>
Output for git.master, git.master_jit, rfc.property-hooks
allowempty

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:
42.89 ms | 401 KiB | 8 Q