It seems that there are no consensus about this feature so...
*if in doubt, leave it out.*
Martin Scotta
On Mon, Apr 11, 2011 at 5:09 PM, Chris Stockton
wrote:
> Hello,
>
> On Mon, Apr 11, 2011 at 11:47 AM, Matthew Weier O'Phinney
> wrote:
> > On 2011-04-11, Stas Malyshev wrote:
> >> > I m
Hello,
On Mon, Apr 11, 2011 at 11:47 AM, Matthew Weier O'Phinney
wrote:
> On 2011-04-11, Stas Malyshev wrote:
>> > I might come off rather crumudgeonly here, but these last few
>> > threads I've seen going across to silence notices have a common
>> > theme - "I wanna be a lazier coder."
My sugg
On Apr 11 12:08:15, Todd Ruth wrote:
> I'm not arguing whether the following code fragment is good
> or bad (it's certainly less than ideal), but given the recent
> threads, I thought I'd show how I feel I've been encourage by
> php to code:
>
> $x = array();
> $y = 'something';
> $temp =& $x[$
On Apr 11 14:14:40, Matt Wilson wrote:
> Something I've been doing for a long time is similar, but in my opinion a
> much better practice.
>
> function coalesce(&$val, $ifnull = false)
> {
> return empty($val) ? $ifnull : $val;
> }
>
> Add whatever restrictive logic you wish here, if empty
Something I've been doing for a long time is similar, but in my opinion a much
better practice.
function coalesce(&$val, $ifnull = false)
{
return empty($val) ? $ifnull : $val;
}
Add whatever restrictive logic you wish here, if empty() isn't good enough for
your purposes.
$_GET['might
I'm not arguing whether the following code fragment is good
or bad (it's certainly less than ideal), but given the recent
threads, I thought I'd show how I feel I've been encourage by
php to code:
I'm not sure where (if anywhere) that technique is documented
or even if it should be documented,
On 2011-04-11, Stas Malyshev wrote:
> > I might come off rather crumudgeonly here, but these last few
> > threads I've seen going across to silence notices have a common
> > theme - "I wanna be a lazier coder."
>
> Laziness is a virtue for a coder :) At least, when it goes to avoid
> unnecessary w
Hi!
I might come off rather crumudgeonly here, but these last few threads I've
seen going across to
silence notices have a common theme - "I wanna be a lazier coder."
Laziness is a virtue for a coder :) At least, when it goes to avoid
unnecessary work - in this example, boilerplate code.
W
Le 11/04/2011 19:17, Michael Morris a écrit :
> But don't ask the engine to be rewritten to encourage bad coding practices
> which failing to properly initialize variables is a prime example of. It's
> this sort of thinking that got register_globals and magic_quotes put into
> the language no doub
I might come off rather crumudgeonly here, but these last few threads I've
seen going across to
silence notices have a common theme - "I wanna be a lazier coder."
Which is fine - set the PHP error level to not show them.
But don't ask the engine to be rewritten to encourage bad coding practices
w
On Apr 10 21:22:58, D. Dante Lorenso wrote:
> The problem with implementing "ifsetor", "filled", or "??" in userland
> is that the "not set" or "undefined" warning is fired before the
> variable is passed to the underlying function/method.
>
> Is it possible to add a modifier that turns off warn
If doing the suppression of undefined notices be better if the ? was put after
the
opening square bracket, thereby removing the ambiguity (which I think would be
more troublesome than you think)? $array[?"foo"]
I suppose a non-array-specific version would be to put it after the $.
$?variable
$
I think another problem with using @ is that it is done by the caller,
not the callee, so it doesn't allow functions like issetor() to be
implemented in userland without expecting every caller to do pass the
variable while silencing errors.
I also don't think the inconvenience is restricted to ar
@ is not convenient since it turns off error reporting for all errors. I
don't know how many times I've silenced a notice and got a blank page in my
face as a "thank you for accidentally silencing that fatal error too".
"Silent" is reserved for the purpose of the silence operator though @ so
using
14 matches
Mail list logo