Symfony doesn't use @ for retrieving get/post parameter, but uses it for database connection and other connection type as well as object chaining, but all these suppress errors are handled/caught somewhere else (e.g.:write them to log or throw them to browser on dev mode).
On Thu, Sep 17, 2009 at 9:00 AM, craiganz <[email protected]> wrote: > > 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. >> > > > -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
