Page MenuHomePhabricator

PHP 7 compatibility: Fix variable interpolation in DataOutputFormatter.php
Closed, ResolvedPublic

Description

For clarity and less unexpected behavior between PHP5 and PHP7, break

mediawiki-extensions/Echo/includes/DataOutputFormatter.php's line
$formatter = new self::$formatters[$format]( $user, $lang );

into two explicit lines, due to

referenceold meaningnew meaning in PHP7
Foo::$bar['baz']()Foo::{$bar['baz']}()(Foo::$bar)['baz']()

Event Timeline

Restricted Application added a subscriber: TerraCodes. · View Herald Transcript

Imported this task into GCI.
I'd appreciate if noone outside of GCI worked on this task for the next two weeks. :)

Change 330142 had a related patch set uploaded (by Georggi199):
Fixed variable interpolation in DataOutputFormatter.php

https://gerrit.wikimedia.org/r/330142

I just CR+2'd that patch... Should they have been fixing both?

Change 330142 merged by jenkins-bot:
Fixed variable interpolation in DataOutputFormatter.php

https://gerrit.wikimedia.org/r/330142

@Reedy: What do you mean with "both"?

From the description

into two explicit lines, due to

From (one implicit line):

$formatter = new self::$formatters[$format]( $user, $lang );

to (two explicit lines):

$class = self::$formatters[$format];
$formatter = new $class( $user, $lang );

?? :D

Reedy assigned this task to Georggi1999.