Last modified: 2010-05-15 16:03:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19407, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17407 - Some errors with PHP 5.3.0.
Some errors with PHP 5.3.0.
Status: RESOLVED DUPLICATE of bug 15854
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.13.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.gamerzcore.net/wiki/index.php
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-08 11:43 UTC by Alex
Modified: 2010-05-15 16:03 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Alex 2009-02-08 11:43:04 UTC
After I upgraded my PHP to 5.3.0, I've started to get these two errors:

Warning: Parameter 2 to Parser::parse() expected to be a reference, value given in /home/site/gzcore/wiki/includes/StubObject.php on line 58
Fatal error: Call to a member function getCacheTime() on a non-object in /home/site/gzcore/wiki/includes/Article.php on line 3387

I've no clue if this version of MW is supposed to work with PHP 5.3.0, but it sure would be nice to get it working.

Thanks.
Comment 1 Chad H. 2009-02-08 17:03:15 UTC
1) From the looks of it, something early on in the process is calling $wgParser while it's still stubbed and trying to run Parser::parse() with invalid arguments. This doesn't appear to have changed in trunk 1.15 either. What extensions are you running? Does disabling them help fix this?

2) This would appear that Parser::parse() is returning a non-ParserOutput return. It's probably related to #1 somehow.
Comment 2 Alex 2009-02-09 10:57:52 UTC
No extensions at all, whatsoever.

Yes, I figured it was returning something incorrect, but I really couldn't make out where it went wrong (mostly because I can't find my way in the source ;)).
Comment 3 Tim Starling 2009-02-10 06:10:40 UTC
Downgrading severity, PHP 5.3 is still in alpha and is subject to change.
Comment 4 Alexandre Emsenhuber [IAlex] 2009-02-11 08:52:17 UTC

*** This bug has been marked as a duplicate of bug 16505 ***
Comment 5 Alexandre Emsenhuber [IAlex] 2009-02-11 08:52:54 UTC
Oops, false bug.

*** This bug has been marked as a duplicate of bug 15854 ***
Comment 6 Peter B. 2009-02-11 20:47:23 UTC
The problem indeed lies in the implementation of the StubObject, it doesn't forward the call properly (there are some warnings about references too); the parse () method-call never reaches the Parser class. This is because of a change in the 5.3 codebase: in previous versions PHP would be silent if you'd pass values in call_user_func_array, even if they were declared references (which in theory wouldn't work - there's nothing to reference to). In PHP 5.3 however this throws a warning, and the function call will be aborted. A simple snippet to reproduce this;

<?php
function test (& $value)
{
        echo 'Hello, world!';
}

call_user_func_array ('test', array (5));
?>

In PHP 5.2 this echos "Hello, world!", in PHP 5.3 nothing other than a warning. I'm not familiar with the MediaWiki codebase so I wasn't capable of producing a proper fix, however, disabling the StubObject did solve the problem. A simple patch is included below, doing nothing else than disabling the StubObject for the Parser class.

Regards,
Peter

---------------------------------------------------

includes/Setup.php : 244

- $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
+ $wgParser = new $wgParserConf['class'] ($wgParserConf);
Comment 7 Alex 2009-02-12 11:09:14 UTC
I'll try with that, thanks. What IS the StubObject though? I wasn't able to figure out what it's used for.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links