Hi. I'll try to be more clear. I've already posted a similar function and i didn't use @ :-)
Symfony uses the construct: @$ary[$elm]; within it's code -- you may or may not make use of the methods that use it. I wasn't trying to suggest @ would be used if you called getParameter. Most of this discussion has focused on a ternary operator that returns null if the array element doesn't exist. I'm certain it's also the most common use of this construct. It just happens to be that the most common use can be replaced with @ :-) -Craig On Sep 17, 8:43 am, Sid Bachtiar <[email protected]> wrote: > You just don't use @$ary[$elm] to write that kind of function since > you need to detect if the index is set or not and return default value > accordingly. > > > Of course if you use symfony, you're simply passing the use of both > > this construct: > > (isset($ary[$elm])) ? $ary[$elm] : null > > and this one: > > �...@$ary[$elm] > > to someone else's code :-) > > I said "I prefer $something = $request->getParameter('something');", > referring to the kind of function/method/class I prefer to use. > --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
