run code in 300+ PHP versions simultaneously
<?php $data = '<?xml version="1.0" encoding="utf-8" ?> <note> <to> <form>heslo0</form> <heading>A</heading> <body>C</body> </to> <to> <form>heslo1</form> <heading>A</heading> <body>F</body> </to> </note>'; $xml = simplexml_load_string($data); foreach ($xml->to as $to){ if ($to->form == 'heslo0' && $to->heading == 'A'){echo "povoleno";} elseif ($to->form == 'heslo0' && $to->heading == 'B'){echo "nepovoleno";} elseif ($to->form == 'heslo0' && $to->heading == 'C'){echo "blokováno";} } // po sem se splní a vypíše "povoleno" foreach ($xml->to as $to){ if ($to->form == 'heslo2' && $to->heading == 'A'){echo "povoleno";} elseif ($to->form == 'heslo2' && $to->heading == 'B'){echo "nepovoleno";} elseif ($to->form == 'heslo2' && $to->heading == 'C'){echo "blokováno";} } // tady už neexistuje daný blok, tak bych chtěl vypsat hlášku třeba "neaktivní" ?>
Output for git.master, git.master_jit

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

64.85 ms | 408 KiB | 5 Q