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{conditions?: callable|callable[], depth?: null|int, excludes?: string[], recursive?: bool, removeKeys?: string[], 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{conditions?: callable|callable[], depth?: null|int, excludes?: string[], recursive?: bool, removeKeys?: string[], 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.