On Mon, Jan 5, 2015 at 9:30 PM, Andrea Faulds <a...@ajf.me> wrote:

>
> > On 5 Jan 2015, at 20:28, Stanislav Malyshev <smalys...@gmail.com> wrote:
> >
> > Hi!
> >
> >> usually each BC break would warrant an RFC and a vote, but I'm not sure
> >> many people would use str_replace("foo", array("bar"), $subject); and
> >> expect the implicit array to string conversion of array("bar") =>
> "Array"
> >> which also emits a notice.
> >> let's see what others think.
> >
> > I wouldn't consider this a BC break. Anybody who relies on implicit
> > array->string conversion has a bug anyway, and we allow that implicit
> > conversion to survive only for legacy reasons, but I don't think it
> > should drag behind itself the promise we'd never support array parameter
> > where there was only string before. In summary, I'd say no BC break here.
>
> To add to what Stas says: ZPP doesn’t allow array->string anyway, this is
> just a quirk in str_replace’s handling of its ‘z’ parameter. So users
> wouldn’t expect it to work anyway, right?
>

users don't know much about how zend parameter parsing works in general,
and both $search and $replace is documented as mixed plus the only
reference about this usage in the documentation is the "The converse would
not make sense, though. " sentence which can be easy to miss.
So while I agree that the current working doesn't make much sense, I don't
think that it is that obvious that this shouldn't behave as it does atm.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to