Re: com php-src: Add json_last_error_msg() function: ext/json/json.c ext/json/tests/003.phpt ext/json/tests/004.phpt ext/json/tests/007.phpt
ext/json/tests/bug54058.phpt ext/json/tests/bug61537.phpt ext/json/tests/inf_nan_error.phpt ext/jso

From: Date: Thu, 28 Jun 2012 21:07:36 +0000
Subject: Re: com php-src: Add json_last_error_msg() function: ext/json/json.c ext/json/tests/003.phpt ext/json/tests/004.phpt ext/json/tests/007.phpt
ext/json/tests/bug54058.phpt ext/json/tests/bug61537.phpt ext/json/tests/inf_nan_error.phpt ext/jso
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-69483@lists.php.net to get a copy of this message
On 28 June 2012 19:11, Nikita Popov <nikic@php.net> wrote: > Commit:    974324676b2436f159f42d9241c569f813471684 > Author:    Nikita Popov <nikic@php.net>         Thu, 28 Jun 2012 20:09:47 +0200 > Parents:   b025b9d0cf9921d26fc4dad43cf26390d0a8c5dd > Branches:  PHP-5.3 PHP-5.4 > > Link:       > http://git.php.net/?p=php-src.git;a=commitdiff;h=974324676b2436f159f42d9241c569f813471684 > > Log: > Add json_last_error_msg() function > > This replaces json_last_error(true) and is consistent with other custom > error handling functions. > I hope you picked this function name to fuel the "PHP is so inconsistent" lovers. Could I suggest picking something a little less a) different from everything else, and b) different from *everything* else? The following is a quick tally of error functions that return error message strings and reference "last" or "previous" in their documented "purpose". *_error_msg (1) *_errcode (1) *_errormsg (4) *_error (17) *_last_error (2) *_get_error (2) *_get_error_message (7) Added to this, is a whole new choice; your *_last_error_msg. The behaviour might be consistent (having a separate error-string-returning function) but the name isn't at all. Appendix - Functions containing "err", returning an error message string with refpurpose mentioning last/previous. cubrid_error_msg dbplus_errcode db2_conn_errormsg db2_stmt_errormsg ifx_errormsg odbc_errormsg curl_error db2_conn_error ingres_error fbsql_error ldap_error maxdb_connect_error maxdb_error maxdb_stmt_error msql_error mysql_error mysqli_connect_error mysqli_error mysqli_stmt_error qdom_error stomp_connect_error stomp_error vpopmail_error imap_last_error pg_last_error enchant_broker_get_error enchant_dict_get_error collator_get_error_message datefmt_get_error_message intl_get_error_message msgfmt_get_error_message numfmt_get_error_message resourcebundle_get_error_message transliterator_get_error_message

« previous php.cvs (#69483) next »