3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!class_exists('SimpleXMLElement')) die("Bonkers"); $xml = new SimpleXMLElement('<xml><node>foo</node></xml>'); var_dump($xml->node); var_dump(gettype($xml->node)); var_dump(isset($xml->node)); var_dump(empty($xml->node)); var_dump(is_null($xml->node)); var_dump(count($xml->node)); var_dump(count($xml->node->children())); var_dump(gettype($xml->node->foo)); var_dump(isset($xml->node->foo)); var_dump(empty($xml->node->foo)); var_dump(is_null($xml->node->foo)); var_dump(count($xml->node->foo)); var_dump(count($xml->node->foo->children()));
Output for git.master, git.master_jit, rfc.property-hooks
object(SimpleXMLElement)#2 (1) { [0]=> string(3) "foo" } string(6) "object" bool(true) bool(false) bool(false) int(1) int(0) string(6) "object" bool(false) bool(true) bool(false) int(0) Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /in/tCh4C:18 Stack trace: #0 {main} thrown in /in/tCh4C on line 18
Process exited with code 255.

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