From: Vincent Vanwaelscappel Date: Thu, 18 Aug 2022 12:23:22 +0000 (+0200) Subject: wip #5399 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=01408416b4bd244224d5cf8ab22d15acc00d088f;p=cubist_util.git wip #5399 @0.5 --- 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; } + }