what is better for performance?
| From: | Karel Kozlik | Date: | Tue, 06 Dec 2005 10:56:25 +0000 |
| Subject: | what is better for performance? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-226913@lists.php.net to get a copy of this message | ||
Hi,
I am just thinking about that what is better for storeing structured variables in point of view of performance.
Is better store structured variables in associative array, for example:
$person['first_name'] = 'Karel';
$person['last_name'] = 'Kozlik';
$person['address'] = 'somewhere on Earth';
or in object like this:
$person->first_name = 'Karel';
$person->last_name = 'Kozlik';
$person->address = 'somewhere on Earth';
I feel that objects are better for performance, but work with associative arrays is pleasanter for me. May be the diference in performance measurable? (in heavy loaded environment)
thanks Karel