Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (3 years ago)
Author:
westonruter
Message:

General: Use static on closures whenever $this is not used to avoid memory leaks.

Props westonruter, jrf, spacedmonkey.
Fixes #58323.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/performance/wp-content/mu-plugins/server-timing.php

    r55459 r55822  
    33add_action(
    44    'template_redirect',
    5     function() {
     5    static function() {
    66
    77        global $timestart;
     
    1616        add_action(
    1717            'shutdown',
    18             function() use ( $server_timing_values, $template_start ) {
     18            static function() use ( $server_timing_values, $template_start ) {
    1919
    2020                global $timestart;
Note: See TracChangeset for help on using the changeset viewer.