Re: [PHP-DEV] Shorthand proposal for associative arrays

2018-01-27 Thread Andrey Andreev
Hi, I've got mixed feelings about this ... On one hand, I've always avoided compact() because it is magic; a hack that was very obviously made because there was no language construct for it. This would've spared me lots of annoyance with code that was already otherwise boring. But on the other ha

Re: [PHP-DEV] Shorthand proposal for associative arrays

2018-01-27 Thread Markus Fischer
Hi, On 28.01.18 03:51, Christian Schneider wrote: 2) More importantly: It hides the variable being used: 'src' instead of $src which makes it harder to search for the variable or statically analyse the code. I'm not sure about that argument. compact() been around basically since forecer. Mod

Re: [PHP-DEV] Shorthand proposal for associative arrays

2018-01-27 Thread Christian Schneider
Am 28.01.2018 um 00:29 schrieb Sara Golemon : > On Fri, Jan 26, 2018 at 4:49 PM, David Rodrigues > wrote: >> Sorry. I mean "compact()" instead of extract() (it basically does the >> oposite hehe), I confused everything in a hurry. Sorry. >> >> So the real example is

Re: [PHP-DEV] Shorthand proposal for associative arrays

2018-01-27 Thread Sara Golemon
On Fri, Jan 26, 2018 at 4:49 PM, David Rodrigues wrote: > Sorry. I mean "compact()" instead of extract() (it basically does the > oposite hehe), I confused everything in a hurry. Sorry. > > So the real example is: html::img(compact('src', 'alt')); > > 2018-01-26 19:39 GMT-02:00 Michael Morris : >

Re: [PHP-DEV] Shorthand proposal for associative arrays

2018-01-27 Thread Rowan Collins
Hi! On 26/01/2018 18:16, Christian Schneider wrote: Hi there, I have a proposal for a shorthand notation of associative arrays borrowed from another language: :$foo would be equivalent to 'foo' => $foo and would work with array, list or [] I'm always a little suspicious of fea