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
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php