The Ds\Vector::apply() function is an inbuilt function in PHP which is used to update all values in the array by applying the callback function to each value of the vector. After this callback, all the values of the vector will get modified as defined in the callback function.
void public Ds\Vector::apply( $callback )
Parameters: This function accepts a single parameter $callback which is used to update the values in the vector. This callback function should return the value by which vector element is to be replaced.
Return Value: This function does not return any value.
Below programs illustrate the Ds\Vector::apply() function in PHP:
Ds\Vector Object (  => 1  => 2  => 3  => 4  => 5 )
Ds\Vector Object (  => 5  => 10  => 15  => 20  => 25 )
- PHP | Ds\Map apply() Function
- PHP | Ds\Deque apply() Function
- PHP | Ds\Sequence apply() Function
- How to apply !important in CSS?
- How to apply multiple transform property to an element using CSS ?
- How to apply border inside a table ?
- How to apply two CSS classes to a single element ?
- How to apply style to parent if it has child with CSS?
- How to apply CSS property to an iframe ?
- How to apply colored shadow and border properties to a grayscale image?
- How to apply CSS page-break to print a table with lots of rows?
- How to apply animation in D3.js?
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.