From 01408416b4bd244224d5cf8ab22d15acc00d088f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 18 Aug 2022 14:23:22 +0200 Subject: [PATCH] wip #5399 @0.5 --- src/ObjectUtil.php | 8 ++++++++ src/PHP.php | 1 + 2 files changed, 9 insertions(+) diff --git a/src/ObjectUtil.php b/src/ObjectUtil.php index 4ea4d82..c3daa30 100644 --- a/src/ObjectUtil.php +++ b/src/ObjectUtil.php @@ -50,5 +50,13 @@ class ObjectUtil return $res; } + public static function merge() { + $res = new \stdClass(); + $args=func_get_args(); + foreach ($args as $v) { + $res = (object) array_merge((array) $res, (array) $v); + } + return $res; + } } diff --git a/src/PHP.php b/src/PHP.php index bcbc8f3..3a86f42 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -76,4 +76,5 @@ class PHP $export = implode(PHP_EOL, array_filter(["["] + $array)); if ($return) return $export; else echo $export; } + } -- 2.39.5