compress.php
Table of Contents
Functions
- compress() : object
- Compress the given object by removing properties that match certain conditions.
Functions
compress()
Compress the given object by removing properties that match certain conditions.
compress(object $object[, array{clone?: bool, conditions?: callable|array|string|null, depth?: null|int, excludes?: array|null, recursive?: bool, removeKeys?: array|null, throwable?: bool} $options = [] ][, int $currentDepth = 0 ]) : object
This function traverses the object and removes properties according to the provided options. It can operate recursively on nested objects and arrays.
Parameters
- $object : object
-
The object to compress.
-
$options
: array{clone?: bool, conditions?: callable|array
|string|null, depth?: null|int, excludes?: array = []|null, recursive?: bool, removeKeys?: array |null, throwable?: bool} -
Optional configuration.
- $currentDepth : int = 0
-
Internal counter used to track recursion depth.
Tags
Return values
object —The compressed object, with properties removed according to the rules.