On 2014-02-18 4:41 PM, Tyler Romeo wrote:
I strongly recommend we do so. A list of nice things about 5.4 that we'd definitely use:
- Array literals
- $this support in closures
- Class member access based on expression
- Class member access after instantiation
- Function return value array dereferencing
- The JsonSerializable interface
- Improved parse_url() behavior
Of course there is traits as well, but that's more of an actual new feature, and it will be a while before MediaWiki starts using traits everywhere.
*-- * *Tyler Romeo* Stevens Institute of Technology, Class of 2016 Major in Computer Science
Actually we'll have even more uses for PHP 5.4: - <?= ?> in skins instead of <?php echo ?> where we do do that. - No more need for safe_mode checks - We can kill our register_global checks in WebStart.php - No more magic_quotes_gpc handling in WebRequestk
But also we do already have a use for traits, RequestContext. We extend from ContextSource because we can't currently use a TContextSource trait. This is fine for the classes that have no parent class but we've run into classes that already have prior obligations. In those instances some code duplication has been necessary.
^_^ With traits we can redefine the ContextSource class as the following and make anything duplicating ContextSource code use a trait.
class ContextSource implements IContextSource { use TContextSource; }
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]