Hi!
It seems that there are no consensus about this feature so...
*if in doubt, leave it out.*
I don't see any serious objections to it except comments from people
that seem not really understand what this feature is about and complain
about bad code which has nothing to do with the actual
Em Tue, 12 Apr 2011 10:04:36 +0100, Stas Malyshev smalys...@sugarcrm.com
escreveu:
It seems that there are no consensus about this feature so...
*if in doubt, leave it out.*
I don't see any serious objections to it except comments from people
that seem not really understand what this
On Mon, Apr 11, 2011 at 4:09 PM Chris Stockton wrote:
My suggestion to use ?? I will say has little to do with laziness. I
would be happy with any solution that solves my problem, I just know
that implementing a patch for ?? would be simple enough (I could even
do so if requested). Everyone
Considering that the main impetus for these threads is to write code
that does not generate the notice regarding missing variables or
indices, neither isset() or empty() will provide that completely.
If a variable is declared, but assigned null, it is not set and it is
empty. But so what. The
On 12 April 2011 12:33, Richard Quadling rquadl...@gmail.com wrote:
[1] http://pastebin.com/qLNYtfAw
Updated to http://pastebin.com/cqSEcGpN to include 0 and '' values.
The output is ...
Undefined variableisset() = false empty() = true
defined = false
Defined variable null
Am 12.04.2011 13:33, schrieb Richard Quadling:
Notice: Undefined variable
Notice: Undefined index
To me, these two notices are totally different in severity, but that may
be because of how i write my code. I'd like to be able to get rid of the
Undefined index Notice in a nice, clean,
@ 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
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
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
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 warnings for
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
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 doubt.
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.
On 2011-04-11, Stas Malyshev smalys...@sugarcrm.com 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
Hello,
On Mon, Apr 11, 2011 at 11:47 AM, Matthew Weier O'Phinney
weierophin...@php.net wrote:
On 2011-04-11, Stas Malyshev smalys...@sugarcrm.com 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
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
chrisstockto...@gmail.comwrote:
Hello,
On Mon, Apr 11, 2011 at 11:47 AM, Matthew Weier O'Phinney
weierophin...@php.net wrote:
On
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 warnings for undefined
variables whenever that specific method is
@.
On Apr 10, 2011, at 9:22 PM, 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
Hi!
@.
Note however it does not exactly turn off the warning, only changes it
to not reported. It's still generated and can be picked up by handlers,
for example.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP
19 matches
Mail list logo