Skip to content

Commit

Permalink
Passing object/array in Objects::walk by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
maryo committed Nov 19, 2017
1 parent 5f8c1d0 commit 1eba532
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Objects.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function getConstants($class, string $prefix = ''): array
* @param callable $callback
* @param string[] $visitedObjects
*/
public static function walk($object, callable $callback, array $visitedObjects = [])
public static function walk(&$object, callable $callback, array $visitedObjects = [])
{
array_walk($object, function (&$value, string $property) use ($object, $callback, $visitedObjects) {
if (is_object($value)) {
Expand Down

0 comments on commit 1eba532

Please sign in to comment.