3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $iterator = new \SimpleXmlIterator('<xml><fotoshow><image>http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png</image><image/><image/></fotoshow></xml>'); $images = $iterator->fotoshow->image; foreach ($images as $value) { var_dump($value); var_dump($value === 0); var_dump(null === $value); var_dump($value === ""); var_dump(empty($value)); var_dump((string) $value); }
Output for 5.3.0 - 5.3.29, 5.5.27 - 5.5.38, 5.6.11 - 5.6.28, 7.0.0 - 7.1.0
object(SimpleXMLIterator)#3 (1) { [0]=> string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" } bool(false) bool(false) bool(false) bool(false) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#5 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) "" object(SimpleXMLIterator)#3 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) ""
Output for hhvm-3.12.0
object(SimpleXMLIterator)#5 (1) { [0]=> string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" } bool(false) bool(false) bool(false) bool(false) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#6 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) "" object(SimpleXMLIterator)#7 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) ""
Output for hhvm-3.10.0
object(SimpleXMLIterator)#5 (0) { } bool(false) bool(false) bool(false) bool(true) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#6 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) "" object(SimpleXMLIterator)#7 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) ""
Output for 5.4.0 - 5.5.26, 5.6.0 - 5.6.10
object(SimpleXMLIterator)#3 (0) { } bool(false) bool(false) bool(false) bool(true) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#5 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) "" object(SimpleXMLIterator)#3 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) ""
Output for 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/tNuhd on line 2 object(SimpleXMLIterator)#3 (1) { [0]=> string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" } bool(false) bool(false) bool(false) bool(false) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#5 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) "" object(SimpleXMLIterator)#3 (0) { } bool(false) bool(false) bool(false) bool(true) string(0) ""
Output for 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/tNuhd on line 2 object(SimpleXMLIterator)#3 (1) { [0]=> string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" } bool(false) bool(false) bool(false) bool(false) string(57) "http://bild.gottes-platz-an-der-sonne.himmel.1/avater.png" object(SimpleXMLIterator)#5 (0) { } bool(false) bool(false) bool(false) bool(false) string(0) "" object(SimpleXMLIterator)#3 (0) { } bool(false) bool(false) bool(false) bool(false) string(0) ""
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/tNuhd on line 2 Fatal error: Cannot instantiate non-existent class: simplexmliterator in /in/tNuhd on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/tNuhd on line 2 Fatal error: Cannot instantiate non-existent class: simplexmliterator in /in/tNuhd on line 2