r90361 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90360‎ | r90361 | r90362 >
Date:20:11, 18 June 2011
Author:platonides
Status:resolved
Tags:
Comment:
There is a nice $limit parameter in PHP 5.4, but calling debug_backtrace on earlier versions with too much parameters, it errors returning null, so we need a PHP_VERSION comparison.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1381,7 +1381,11 @@
13821382 return array();
13831383 }
13841384
1385 - return array_slice( debug_backtrace(), 1 );
 1385+ if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
 1386+ return array_slice( debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT, 1 ), 1 );
 1387+ } else {
 1388+ return array_slice( debug_backtrace(), 1 );
 1389+ }
13861390 }
13871391
13881392 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r90362Follow up r90361platonides20:15, 18 June 2011
r95493Followup r90361, r90362...reedy16:40, 25 August 2011

Status & tagging log