Re: is it allowed to override default constants(TRUE,FALSE)? see bug 5217

From: Date: Wed, 26 Jul 2000 16:03:33 +0000
Subject: Re: is it allowed to override default constants(TRUE,FALSE)? see bug 5217
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-26331@lists.php.net to get a copy of this message
Hi! > At 12:10 26-07-00, waldschrott wrote: > >>It shouldn't be allowed. > > > >Thus we should have an undefine() or unset() (which unsets defined vars) > >to allow redefinition of *user*-constants, all others shouldn´t be allowed > >to touch... > > > > > >> > I get the same results, but I don´t think it´s a bug, BTW -1 is > >> > treated as FALSE value normally... > >>-1 is not treated as false, only 0 is treaded as false. > > > >I should have said, treated in my scripts as false. I use negative values > >for error handling.... > > They don't mean false in the language level, and we won't change that; If > you want to give negative values a logical meaning of false in your > scripts, then you're quite welcome to do that, but without the language's > help :) if fact it's a practice in C coding to have something like status = call_function (); if (status < 0) { do_something(); } so you can use negative error codes in an elegant (structured) manner. Zeev was more kind to invite you to change your way of thinking, than say Stas, though :)) -- teodor

« previous php.dev (#26331) next »