note 92963 added to function.simplexml-element-construct

From: Date: Mon, 17 Aug 2009 01:52:58 +0000
Subject: note 92963 added to function.simplexml-element-construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-159557@lists.php.net to get a copy of this message
As I was filling out a bug report, I realized why (speculation here) the constructor is final: so that functions like simplexml_load_file and simplexml_load_string can work. I imagine the PHP-ized code looks something like <?php function simplexml_load_file($filename, $class_name = "SimpleXMLElement", $options = 0, $ns = "", $is_prefix = false) { return new $class_name($filename, $options, true, $ns, $is_prefix); } ?> If we were to use a different $class_name and change the constructor's definition these functions wouldn't work. There's no easy, sensible solution that keeps simplexml_load_file and simplexml_load_string. ---- Server IP: 64.71.164.2 Probable Submitter: 75.172.106.161 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-construct.php Edit -- https://master.php.net/note/edit/92963 Del: integrated -- https://master.php.net/note/delete/92963/integrated Del: useless -- https://master.php.net/note/delete/92963/useless Del: bad code -- https://master.php.net/note/delete/92963/bad+code Del: spam -- https://master.php.net/note/delete/92963/spam Del: non-english -- https://master.php.net/note/delete/92963/non-english Del: in docs -- https://master.php.net/note/delete/92963/in+docs Del: other reasons-- https://master.php.net/note/delete/92963 Reject -- https://master.php.net/note/reject/92963 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159557) next »