Is there a PHP Doc syntax for "function changes the argument passed by reference"?

When writing a PHP document for a function, if the function returns a value, you should write something like

@return array $someArray An array of formatted dates

But let's say that my function does not return a value, but rather changes the original value, which is passed as a link, for example:

   function formatDates(&$input_arr){
        /**
         * Formats an array of dates
         * @param array $input_arr An array of raw dates
         */
        array_walk_recursive($input_arr, 'formatDateFunction');
    }

This function modifies the input array.

I know this with help &in front of the parameter, but the return values ​​are pretty obvious with the help returnin front of them, so I feel there might be a standard for this?

Currently, I just mention it in the function description, for example:

        /**
         * Formats an array of dates, modifies original array

Is there a commonly used way to declare a function to change an input value in PHP documents? Or is it just normal, as implied?

+4
1

* @param array &$array modified parameter array of dates

+3

All Articles