Re: [RFC] ICU UConverter implementation for ext/intl
| From: | Gustavo Lopes | Date: | Tue, 30 Oct 2012 08:42:17 +0000 |
| Subject: | Re: [RFC] ICU UConverter implementation for ext/intl | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63715@lists.php.net to get a copy of this message | ||
Em 2012-10-30 2:57, Sara Golemon escreveu:
http://wiki.php.net/rfc/uconverter Discuss!Good work. I do, however, have some concerns: * Error handling is done in a different way from the rest of the extension. Error handling in ext/intl is, admittedly, a little strange. Errors are both stored globally (to be retrieved by intl_get_error_code() and intl_get_error_message()) and in the object that raised them (through ::getErrorCode() and ::getErrorMessage()). The mechanism in ICU where one can do several calls in succession and check the error code only at the end is broken; the error codes are reset at the start of each call. The errors may raise any kind of PHP error (depending on the value of a INI setting, intl.error_level) or an exception (activated globally via intl.use_exceptions). On failure, functions/methods return false (constructors and factory methods return null). Unusual as this may be, it would be a bad idea to introduce inconsistency here. See the implementations in the other modules. * The tests have poor coverage. -- Gustavo Lopes