1--TEST-- 2GH-14638: null pointer dereference on object cast __toString after failed XML parsing 3--EXTENSIONS-- 4simplexml 5--CREDITS-- 6YuanchengJiang 7--FILE-- 8<?php 9$xml = '<?xml version="1.0" encoding="utf-8" ?> 10<test> 11</test>'; 12$root = simplexml_load_string($xml); 13try { 14 $root->__construct("malformed"); 15} catch (Exception $e) { 16 // Intentionally empty 17} 18echo $root; 19?> 20--EXPECTF-- 21Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in %s on line %d 22 23Warning: SimpleXMLElement::__construct(): malformed in %s on line %d 24 25Warning: SimpleXMLElement::__construct(): ^ in %s on line %d 26