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
--

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to