Re: [PHP-CVS] 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/bug61

2012-06-30 Thread Stas Malyshev
Hi!

 
 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?
 

I think function name should be changed, and also all these big changes
better belong to 5.5 than 5.3.

I would propose renaming json_last_error to json_errno (keeping the
json_last_error as an alias for BC) and having json_error as error
message - just like all DB functions and many others do.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] 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/bug61

2012-06-30 Thread Laruence
On Sun, Jul 1, 2012 at 6:45 AM, Stas Malyshev smalys...@sugarcrm.com wrote:
 Hi!


 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?


 I think function name should be changed, and also all these big changes
 better belong to 5.5 than 5.3.

 I would propose renaming json_last_error to json_errno (keeping the
 json_last_error as an alias for BC) and having json_error as error
 message - just like all DB functions and many others do.
in this case,

I would suggest,  json_errno,  json_strerr,  :)

thanks
 --
 Stanislav Malyshev, Software Architect
 SugarCRM: http://www.sugarcrm.com/
 (408)454-6900 ext. 227

 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] 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/bug61

2012-06-28 Thread Peter Cowburn
On 28 June 2012 19:11, Nikita Popov ni...@php.net wrote:
 Commit:    974324676b2436f159f42d9241c569f813471684
 Author:    Nikita Popov ni...@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

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php