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