From ea2d79109595f0c936259ffacfccd904f8dcd599 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 31 Dec 2005 10:48:56 +0000 Subject: - Patch 41169 by Chris: got rid of expensvie object 2 array casts. --- includes/common.inc | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 6fc543633..210403561 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -489,50 +489,6 @@ function fix_gpc_magic() { } } -/** - * @name Conversion - * @{ - * Converts data structures to different types. - */ - -/** - * Convert an associative array to an anonymous object. - */ -function array2object($array) { - if (is_array($array)) { - $object = new StdClass(); - foreach ($array as $key => $value) { - $object->$key = $value; - } - } - else { - $object = $array; - } - - return $object; -} - -/** - * Convert an object to an associative array. - */ -function object2array($object) { - if (is_object($object)) { - foreach ($object as $key => $value) { - $array[$key] = $value; - } - } - else { - $array = $object; - } - - return $array; -} - - -/** - * @} End of "Conversion". - */ - /** * @name Messages * @{ -- cgit v1.2.3