3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = <<<XML <row> <entry XY="1" al="23" se="5" ag="fgh"></entry> <entry XY="1" al="23" se="5" ag="fgh">Content1</entry> <entry XY="1" al="23" se="5" ag="fgh">Content2</entry> <entry XY="1" al="23" se="5" ag="fgh"> </entry> <entry XY="1" al="23" se="5" ag="fgh">Content3</entry> </row> XML; $xml = simplexml_load_string($x); //$y = $xml->xpath("//entry[not(text()) and (text()!=' ')]"); $y = $xml->xpath("//entry[text() and text()!=' ']"); var_dump($y);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(4) { ["XY"]=> string(1) "1" ["al"]=> string(2) "23" ["se"]=> string(1) "5" ["ag"]=> string(3) "fgh" } [0]=> string(8) "Content1" } [1]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(4) { ["XY"]=> string(1) "1" ["al"]=> string(2) "23" ["se"]=> string(1) "5" ["ag"]=> string(3) "fgh" } [0]=> string(8) "Content2" } [2]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(4) { ["XY"]=> string(1) "1" ["al"]=> string(2) "23" ["se"]=> string(1) "5" ["ag"]=> string(3) "fgh" } [0]=> string(8) "Content3" } }

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:
54.66 ms | 402 KiB | 8 Q