profileinfo: Suppress frivolous warning about usort callback
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 18 Nov 2015 01:24:20 +0000 (01:24 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 18 Nov 2015 01:30:09 +0000 (01:30 +0000)
When sorting the profile output by a column (e.g. ms/call) the
following error appears:

> PHP Warning:
> usort(): Array was modified by the user comparison function at profileinfo.php:439

This is a known bug in PHP where usage of certain debug features
can cause usort() to detect reference count change and wrongly
claim that the object was changed.

Change-Id: I89ec0149aae46f51de647cdf6c6d645c45cbc185

profileinfo.php

index f44ee5a..609ea95 100644 (file)
@@ -436,7 +436,9 @@ if ( isset( $_REQUEST['filter'] ) ) {
        }
        $points[] = $s;
 
-       usort( $points, 'compare_point' );
+       // @codingStandardsIgnoreStart
+       @usort( $points, 'compare_point' );
+       // @codingStandardsIgnoreEnd
 
        foreach ( $points as $point ) {
                if ( strlen( $filter ) && !strstr( $point->name(), $filter ) ) {