@@ -191,26 +191,6 @@ class XML_Parser extends PEAR
191191 */
192192 var $ _validEncodings = array ('ISO-8859-1 ' , 'UTF-8 ' , 'US-ASCII ' );
193193
194- // }}}
195- // {{{ php4 constructor
196-
197- /**
198- * Creates an XML parser.
199- *
200- * This is needed for PHP4 compatibility, it will
201- * call the constructor, when a new instance is created.
202- *
203- * @param string $srcenc source charset encoding, use NULL (default) to use
204- * whatever the document specifies
205- * @param string $mode how this parser object should work, "event" for
206- * startelement/endelement-type events, "func"
207- * to have it call functions named after elements
208- * @param string $tgtenc a valid target encoding
209- */
210- function XML_Parser ($ srcenc = null , $ mode = 'event ' , $ tgtenc = null )
211- {
212- XML_Parser::__construct ($ srcenc , $ mode , $ tgtenc );
213- }
214194 // }}}
215195 // {{{ php5 constructor
216196
@@ -226,7 +206,7 @@ function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null)
226206 */
227207 function __construct ($ srcenc = null , $ mode = 'event ' , $ tgtenc = null )
228208 {
229- $ this -> PEAR ('XML_Parser_Error ' );
209+ parent :: __construct ('XML_Parser_Error ' );
230210
231211 $ this ->mode = $ mode ;
232212 $ this ->srcenc = $ srcenc ;
@@ -279,9 +259,9 @@ function setMode($mode)
279259 * @access public
280260 * @since v1.2.0beta3
281261 */
282- function setHandlerObj (& $ obj )
262+ function setHandlerObj ($ obj )
283263 {
284- $ this ->_handlerObj = & $ obj ;
264+ $ this ->_handlerObj = $ obj ;
285265 return true ;
286266 }
287267
@@ -298,14 +278,14 @@ function _initHandlers()
298278 }
299279
300280 if (!is_object ($ this ->_handlerObj )) {
301- $ this ->_handlerObj = & $ this ;
281+ $ this ->_handlerObj = $ this ;
302282 }
303283 switch ($ this ->mode ) {
304284
305285 case 'func ' :
306286 xml_set_object ($ this ->parser , $ this ->_handlerObj );
307- xml_set_element_handler ($ this ->parser ,
308- array (& $ this , 'funcStartHandler ' ), array (& $ this , 'funcEndHandler ' ));
287+ xml_set_element_handler ($ this ->parser ,
288+ array ($ this , 'funcStartHandler ' ), array ($ this , 'funcEndHandler ' ));
309289 break ;
310290
311291 case 'event ' :
@@ -513,15 +493,15 @@ function parse()
513493
514494 while ($ data = fread ($ this ->fp , 4096 )) {
515495 if (!$ this ->_parseString ($ data , feof ($ this ->fp ))) {
516- $ error = & $ this ->raiseError ();
496+ $ error = $ this ->raiseError ();
517497 $ this ->free ();
518498 return $ error ;
519499 }
520500 }
521501 } else {
522502 // otherwise, $this->fp must be a string
523503 if (!$ this ->_parseString ($ this ->fp , true )) {
524- $ error = & $ this ->raiseError ();
504+ $ error = $ this ->raiseError ();
525505 $ this ->free ();
526506 return $ error ;
527507 }
@@ -569,7 +549,7 @@ function parseString($data, $eof = false)
569549 }
570550
571551 if (!$ this ->_parseString ($ data , $ eof )) {
572- $ error = & $ this ->raiseError ();
552+ $ error = $ this ->raiseError ();
573553 $ this ->free ();
574554 return $ error ;
575555 }
@@ -610,10 +590,10 @@ function free()
610590 *
611591 * @return XML_Parser_Error reference to the error object
612592 **/
613- function & raiseError ($ msg = null , $ ecode = 0 )
593+ function raiseError ($ msg = null , $ ecode = 0 )
614594 {
615595 $ msg = !is_null ($ msg ) ? $ msg : $ this ->parser ;
616- $ err = & new XML_Parser_Error ($ msg , $ ecode );
596+ $ err = new XML_Parser_Error ($ msg , $ ecode );
617597 return parent ::raiseError ($ err );
618598 }
619599
@@ -634,9 +614,9 @@ function funcStartHandler($xp, $elem, $attribs)
634614 $ func = 'xmltag_ ' . $ elem ;
635615 $ func = str_replace (array ('. ' , '- ' , ': ' ), '_ ' , $ func );
636616 if (method_exists ($ this ->_handlerObj , $ func )) {
637- call_user_func (array (& $ this ->_handlerObj , $ func ), $ xp , $ elem , $ attribs );
617+ call_user_func (array ($ this ->_handlerObj , $ func ), $ xp , $ elem , $ attribs );
638618 } elseif (method_exists ($ this ->_handlerObj , 'xmltag ' )) {
639- call_user_func (array (& $ this ->_handlerObj , 'xmltag ' ),
619+ call_user_func (array ($ this ->_handlerObj , 'xmltag ' ),
640620 $ xp , $ elem , $ attribs );
641621 }
642622 }
@@ -657,9 +637,9 @@ function funcEndHandler($xp, $elem)
657637 $ func = 'xmltag_ ' . $ elem . '_ ' ;
658638 $ func = str_replace (array ('. ' , '- ' , ': ' ), '_ ' , $ func );
659639 if (method_exists ($ this ->_handlerObj , $ func )) {
660- call_user_func (array (& $ this ->_handlerObj , $ func ), $ xp , $ elem );
640+ call_user_func (array ($ this ->_handlerObj , $ func ), $ xp , $ elem );
661641 } elseif (method_exists ($ this ->_handlerObj , 'xmltag_ ' )) {
662- call_user_func (array (& $ this ->_handlerObj , 'xmltag_ ' ), $ xp , $ elem );
642+ call_user_func (array ($ this ->_handlerObj , 'xmltag_ ' ), $ xp , $ elem );
663643 }
664644 }
665645
@@ -761,7 +741,7 @@ function XML_Parser_Error($msgorparser = 'unknown error', $code = 0, $mode = PEA
761741 xml_get_current_line_number ($ msgorparser ),
762742 xml_get_current_column_number ($ msgorparser ));
763743 }
764- $ this -> PEAR_Error ($ msgorparser , $ code , $ mode , $ level );
744+ parent :: __construct ($ msgorparser , $ code , $ mode , $ level );
765745 }
766746 // }}}
767747}
0 commit comments