Some reference from PHP itself, if this helps sway preferences:-

Methods using 'as':-
SimpleXMLElement->asXML()

Methods using 'to':-
CachingIterator::__toString()

Functions using 'to':-
iterator-to-array() [SPL]
cal_to_jd()
cpdf_save_to_file()
image_type_to_extension()
image_type_to_mime_type()
ldap_8859_to_t61()
ldap_t61_to_8859()
mysql_get_proto_info()
mysqli_get_proto_info()
openssl_csr_export_to_file()
openssl_pkey_export_to_file()
openssl_x509_export_to_file()
php_stream_copy_to_mem()
php_stream_copy_to_stream()
pspell_add_to_personal()
pspell_add_to_session()
stream_copy_to_stream()
variant_date_to_timestamp()
xml_parse_into_struct()
xsl_xsltprocessor_transform_to_doc()
xsl_xsltprocessor_transform_to_uri()
xsl_xsltprocessor_transform_to_xml()

2c - I'd be more inclined to use 'to' than 'as' since it more obviously describes a transformation.

I think there was recently another thread about naming conventions, though right now I can not remember what the conclusions of that discussion were. Check the archives, I'm sure it's easy to find.

On 10/7/06, Ralf Eggert <[EMAIL PROTECTED]> wrote: Hi,

is there a reason why the functions Zend_Config::asArray() and
Zend_Db_Row::toArray() are not called the same?

Both functions return an array. So why not call them the same, either
toArray() or asArray()?

Best Regards,

Ralf




--
Stefan Koopmanschap
http://www.stefankoopmanschap.nl/
http://www.leftontheweb.com/

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com


Reply via email to