Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45843 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93466 invoked from network); 19 Oct 2009 12:13:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2009 12:13:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathieu.suen@easyflirt.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mathieu.suen@easyflirt.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain easyflirt.com designates 91.199.255.56 as permitted sender) X-PHP-List-Original-Sender: mathieu.suen@easyflirt.com X-Host-Fingerprint: 91.199.255.56 python-06.easyrencontre.com Linux 2.6 Received: from [91.199.255.56] ([91.199.255.56:38617] helo=mail.easyflirt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/91-19266-6F75CDA4 for ; Mon, 19 Oct 2009 08:13:44 -0400 Received: from [127.0.0.1] (office.easyrencontre.com [78.155.152.6]) by mail.easyflirt.com (Postfix) with ESMTPSA id EA5506374E2 for ; Mon, 19 Oct 2009 14:13:38 +0200 (CEST) Message-ID: <4ADC57F3.9010401@easyflirt.com> Date: Mon, 19 Oct 2009 14:13:39 +0200 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Performance question about create_function From: mathieu.suen@easyflirt.com (Mathieu Suen) Hi, Looking at the way array_map is working, it could worth to use create_function for object. For example if I got a list of object: $callback = create_function($element, 'return $selement->getId();'); $ids = array_map($callback, $someInstances); But I don't know if it's cost a lot in performance instead of the ugly verbose way: $ids = array(); foreach($someInstances) { $ids[] = $someInstances->getId(); } Of course I don't expect it to be faster but I hope that could worth the cost. Thanks -- -- Mathieu Suen --