[buddypress-trac] [BuddyPress Trac] #7299: PHP 5.2 -> PHP 5.3 code improvements

buddypress-trac noreply at wordpress.org
Fri Oct 21 21:41:22 UTC 2016

#7299: PHP 5.2 -> PHP 5.3 code improvements
 Reporter:  DJPaul       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  2.8
Component:  Core         |    Version:
 Severity:  normal       |   Keywords:
 This ticket is to discuss asynchronously how we should start to use PHP
 5.3 in the existing codebase. I do not think it is wise to just go and
 change everything possible in one go just because we can, but there are a
 few areas that I'd personally like to see update. It is a tricky balance
 and we should have some consensus amongst frequent contributors of how we
 should approach it.

 Areas we could change:

 * Remove compatibility functions for PHP functions that don't exist in PHP
 5.2. Reason would be to remove dead code branches which, as we'd never
 expect them to be used, would be missed in the future if some bug was
 found in them. I've only found one so far:
  * `BP_Activity_Activity::array_replace_recursive`.
 * Anonymous functions/closures.
  * See class `BP_Core_Sort_By_Key_Callback`
 * Using `func_get_args` as a function parameter.
  * Search for `$func_args = func_get_args();` in BP.
 * Autoloader support.
  * All the `do_nav_backcompat` checks that Boone added a few versions
 * The functions in bp-core-dependency.php long have a note that says
 replace with anonymous functions.
  * This would be by design because unhooking these core BuddyPress actions
 would just break BuddyPress.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7299>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list