map.php
Table of Contents
Functions
- map() : object
- Transforms every public property value of an object through a callback.
Functions
map()
Transforms every public property value of an object through a callback.
map(object $object, callable $fn) : object
Returns a new stdClass with the same property names, each value replaced by the
result of fn( $value , $key ). The source object is never modified.
Parameters
- $object : object
-
The source object.
- $fn : callable
-
The mapping callback:
fn( $value , $key ): mixed.
Tags
Return values
object —A new stdClass with mapped values.