3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xml = simplexml_load_string("<?xml version='1.0' ?> <ImageSets> <ImageSet Category='primary'> <SwatchImage> <URL>www.url.jpg</URL> </SwatchImage> </ImageSet> </ImageSets> "); $primary_url = ''; foreach ($xml->ImageSet as $set) { if ($set->attributes()->Category == 'primary') { $primary_url = $set->SwatchImage->URL; break; } } echo $primary_url;

Abusive script

This script was stopped while abusing our resources

Output for 5.3.0 - 5.4.28
www.url.jpg