Ashar Voultoiz wrote:
Looking at INSTALL it seems we are still supporting
PHP version 5.1
which is 5 years old in a couple of weeks. This is getting old and
prevents developers from using some new features.
Ideally we could raise it to 5.3 to get Namespace support, closures but
that might be to early since most webhost probably still use 5.2.x.
Would it be possible to consider raising the requirement to at least
5.2.0 ? This would give us native JSON support and most probably the
filter extension enabled by default. The later can be used to speed up
the input validation.
Apparently WordPress had this discussion in July, but unlike us, they
had usage statistics:
<http://wpdevel.wordpress.com/2010/07/09/suggest-topics-for-the-july-15-2010-dev/>
For WordPress 2.7+ as of July, the version distribution was:
4.3 – 1.3%
4.4 – 6.3%
5.0 – 0.1%
5.1 – 3.5%
5.2 – 85.4%
5.3 – 3.4%
I don't think JSON support is particularly important since it can
easily be simulated, and I don't think you should use the filter
extension in MediaWiki, regardless of whether it is supported.
However, I can think of a good argument for moving to PHP 5.2, which
is to stop the high rate of bit rot in 5.1 support. In particular,
support for callbacks with double-colons to indicate static method calls:
call_user_func( 'Foo::bar' )
was added in PHP 5.2.3. Developers often use these, and don't realise
that they are breaking PHP 5.1 support. So I think there's a good
argument for making 5.2.3 the minimum.
Another example of bit rot: the trunk has 3 calls to
array_fill_keys(), with no simulation in GlobalFunctions.php; it was
added in 5.2.0. Developers should really check the versions in the
manual when they use a function, otherwise 5.2.x will soon be broken
as well, in favour of 5.3.x. But in theory we can weed out calls to
newly-added functions with grep. The 5.2.3 callback change was more
subtle.
-- Tim Starling