pick.php
Table of Contents
Functions
- pick() : object
- Keeps only the specified public properties of an object.
Functions
pick()
Keeps only the specified public properties of an object.
pick(object $object, array<int, string> $keys) : object
Returns a new stdClass containing only the listed properties that actually exist
on the source object. The source object is never modified. Keys that are absent are
silently ignored.
Parameters
- $object : object
-
The source object.
- $keys : array<int, string>
-
The list of property names to keep.
Tags
Return values
object —A new stdClass with only the picked properties.