1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
dolibarr_ynh/sources/dolibarr/htdocs/includes/restler/Data/Arr.php
Laurent Peuch e6008fc691 init
2015-09-28 22:09:38 +02:00

33 lines
No EOL
799 B
PHP

<?php
namespace Luracast\Restler\Data;
/**
* Convenience class for Array manipulation
*
* @category Framework
* @package Restler
* @author R.Arul Kumaran <arul@luracast.com>
* @copyright 2010 Luracast
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://luracast.com/products/restler/
*/
class Arr
{
/**
* Deep copy given array
*
* @param array $arr
*
* @return array
*/
public static function copy(array $arr)
{
$copy = array();
foreach ($arr as $key => $value) {
if (is_array($value)) $copy[$key] = static::copy($value);
else if (is_object($value)) $copy[$key] = clone $value;
else $copy[$key] = $value;
}
return $copy;
}
}