MediaWiki  REL1_22
PhpBugTests.php
Go to the documentation of this file.
00001 <?php
00030 class PhpXmlBugTester {
00031     private $parsedData = '';
00032     public $ok = false;
00033 
00034     public function __construct() {
00035         $charData = '<b>c</b>';
00036         $xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
00037 
00038         $parser = xml_parser_create();
00039         xml_set_character_data_handler( $parser, array( $this, 'chardata' ) );
00040         $parsedOk = xml_parse( $parser, $xml, true );
00041         $this->ok = $parsedOk && ( $this->parsedData == $charData );
00042     }
00043 
00044     public function chardata( $parser, $data ) {
00045         $this->parsedData .= $data;
00046     }
00047 }
00048 
00054 class PhpRefCallBugTester {
00055     public $ok = false;
00056 
00057     function __call( $name, $args ) {
00058         $old = error_reporting( E_ALL & ~E_WARNING );
00059         call_user_func_array( array( $this, 'checkForBrokenRef' ), $args );
00060         error_reporting( $old );
00061     }
00062 
00063     function checkForBrokenRef( &$var ) {
00064         if ( $var ) {
00065             $this->ok = true;
00066         }
00067     }
00068 
00069     function execute() {
00070         $var = true;
00071         call_user_func_array( array( $this, 'foo' ), array( &$var ) );
00072     }
00073 }