Hi Stas,
On Thu, Jan 30, 2014 at 3:21 AM, Stas Malyshev <[email protected]>wrote:
> > Compare: $str = str_replace('-', '_', $str);
> >
> > To: $str = $str->replace('-', '_');
> >
> > Or: $keys = array_keys($array);
> >
> > To: $keys = $array->keys();
> >
> > I think it looks a lot cleaner, self-explaining, shorter, and if you
> > are used to write OOP, it fits better to the rest of your code.
>
> I think it has very little difference and entirely a matter of personal
> taste. But the thing is - nobody prevents anybody from writing an
> extension that does string ops or array ops as an object. Yet it did not
> happen in last 10 years, AFAIK.
It was said and didn't happen...
I would like to make session/pgsql a class some day. I don't know
when it will be, since I'm satisfied with current implementation.
Besides OO API, we should keep function API. It may be confusing
to users if OO and function name differs.
It may be good to add proper aliases now and when it is needed,
so that we don't have
const zend_function_entry server_additional_functions[] = {
PHP_FE(cli_set_process_title, arginfo_cli_set_process_title)
PHP_FE(cli_get_process_title, arginfo_cli_get_process_title)
PHP_FE(apache_request_headers, arginfo_no_args)
PHP_FE(apache_response_headers, arginfo_no_args)
PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args)
{NULL, NULL, NULL}
};
this kind of naming anymore.
I understand reason why, but *new* 'apache_*()' function in cli server
does not make much sense to me. For this case, I suggest 'sapi_*()'
or 'http_*()' as main name and others as aliases.
Regards,
--
Yasuo Ohgaki
[email protected]