It would make sense for it to be the last argument. My first thought was also that PHP doesn't usually care if you add extra arguments, but "internal callbacks" made me think they were C callbacks, and in that case I don't really know.
On Wed, Jul 17, 2024 at 10:08 AM Rob Landers <rob@bottled.codes> wrote: > > On Wed, Jul 17, 2024, at 09:55, Lily Bergonzat wrote: > > While it *is* indeed a workaround, you can very easily > access the values of the array from the keys, since that > literally is what the keys are for. > > While I also think it's weird that not all php array functions > with callbacks do pass the key as an argument, and while > I also stumbled upon that problem in the past myself > multiple times, I also think it is worth taking the time to > consider what other people from this mailing list are > bringing up. If it could indeed break internal callbacks, > then I think using the workaround could be a better idea > than potentially breaking other things. > > On Wed, Jul 17, 2024 at 2:38 AM Bilge <bi...@scriptfusion.com> wrote: > > > > On Wed, 17 Jul 2024, 01:29 mickmackusa, <mickmack...@gmail.com> wrote: > >> > >> It is untrue that you "can't access it"; you just need to use an array of > >> keys as the input array. > > > > It is absolutely true and your workaround is just that; a workaround that > > doesn't work at all when you also need the value. > > > > Cheers, > > Bilge > > > If it can be the last argument, then PHP doesn't care if you call a function > with extra arguments ... at least, it usually doesn't. > > — Rob