function table / hashes

From: Date: Fri, 27 Apr 2001 04:03:11 +0000
Subject: function table / hashes
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-52558@lists.php.net to get a copy of this message
Thank you Andi and Andrei. I have noticed that object method callbacks are consistently faster than global function callbacks, and was wondering why: 1.3135770559311 seconds for 100000 runs - with no function callback 6.9758139848709 seconds for 100000 runs - with object method callback 7.9048730134964 seconds for 100000 runs - with global function callback This is somewhat strange for me as I would expect objects to be slower if it has to look up the class and then locate the function table? I'm exploring hashes now. I find code like this in php_imap.c: if (zend_hash_find(Z_ARRVAL_PP(envelope), "remail", sizeof("remail"), (void **) &pvalue)== SUCCESS) { convert_to_string_ex(pvalue); env->remail=cpystr(Z_STRVAL_PP(pvalue)); } Is that legal? It seems that it would alter the original array by forcing conversion to string. Lastly, I am trying to see the difference between zend_hash_find and zend_hash_quick_find. Would I be correct in assuming quick_find only looks at string keys, and it would be safe to use this if the function expects only associative arrays? Thanks again! David -- |> /+\ \| | |> David Croft Infotrek On Thu, 26 Apr 2001, Andi Gutmans wrote: > At 02:16 PM 4/26/2001 -0400, David Croft wrote: > > >Hello, I'm implementing an extension that allows user callbacks. > > > >The Zend API document suggests using the Compiler globals to access the > >function table. However I see the XML extension is using Executor globals. > > During execution the correct table to use is the executor globals one, > i.e., EG(function_table). > > Andi > >

« previous php.dev (#52558) next »