Strange Error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pekler
Forum Newbie
Posts: 1
Joined: Tue Jul 27, 2010 9:59 am

Strange Error

Post by pekler »

I get an error on line 63 which is in bold below in the function. Here is the error: Parse error: syntax error, unexpected T_VARIABLE in /home/sites/.........bla bla bla on line 63. Anyone know whats going on there?

Code: Select all

function staticGetMultiple($ids, $limit=9, $start=0) {

		$object = new DataObjects_Registration();
		if (is_array($ids) && count ($ids)) {
			$object->whereAdd('id IN ('.implode(',',$ids).')');
		#	$object->limit($start,$limit);
		} else {
			return array();
		}
		$object->find();

		$objects = array();
		while ($object->fetch()) {
			$tmpObject = new Registration();
			[u][b]$tmpObject->importDataObject(clone $object);[/b][/u]
			$tmpObject->setRegistration(str_replace(' ','',$tmpObject->getRegistration()));
			$objects[$tmpObject->getId()] = clone $tmpObject;
		}
		$orderedObjects = array();
		foreach ($ids as $id) {
			$orderedObjects[] = clone $objects[$id];
		}
		return $orderedObjects;

	}
Last edited by Benjamin on Tue Jul 27, 2010 10:08 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Strange Error

Post by Benjamin »

Perhaps your version of PHP does not support clone.
Post Reply