Solved

why no error ?

Posted on 2003-12-03
8
212 Views
Last Modified: 2006-11-17
If i have this i get no error ? Why ?

<?php

!
$variable;

?>
0
Comment
Question by:pdd
8 Comments
 
LVL 13

Expert Comment

by:lozloz
ID: 9872050
i don't think it's actually syntactically incorrect - ! means not, so you're just saying not a variable which would presumably return true (not that it matters)

the line break probably doesn't affect it

cheers,

loz
0
 
LVL 19

Expert Comment

by:Michael701
ID: 9872061
i get this

Notice: Undefined variable: variable in C:\website\Michael\test.php on line 4
0
 
LVL 13

Expert Comment

by:lozloz
ID: 9872114
yeh that's if you have the php config set up to print warning's, mine doesn't and i assume pdd's doesn't

loz
0
 
LVL 6

Expert Comment

by:rjdown
ID: 9872542
pdd you need to look at your php.ini file

There will be a line saying:

error_reporting  =  (something here)

and another one saying

display_errors = (something here)

in a development environment, recommended settings are:
error_reporting  =  E_ALL & ~E_NOTICE
and
display_errors = On

but you may want to reconsider this in a production environment, as, and I quote, "Keeping display_errors enabled on a production web site may reveal security information to end users, such as file paths on your Web server, your database schema or other information"
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Expert Comment

by:nsanden
ID: 9873034
Yeah whenever your developing/debugging just add this to the top of your script:

error_reporting (E_ALL);

I would turn it off (just comment it out) once your done debugging for extra security as rjdown commented.
0
 
LVL 4

Author Comment

by:pdd
ID: 9874590
rjdown, i had

error_reporting  =  E_ALL & ~E_NOTICE
and
display_errors = On

in the first place.

ok,

how about this ?

<?php

error_reporting (E_ALL);

!!!!!!!!!!
$test_var = "string";

?>
0
 
LVL 13

Accepted Solution

by:
lozloz earned 25 total points
ID: 9874666
why are you wanting this to produce an error? it doesn't with me and i didn't really expect it to - each time you add a ! it's negating the effect of the previous one, and so i still dont think this is technically wrong. if you want to produce an error then just type some random gibberish in, maybe copy one of my posts ;P

loz
0
 
LVL 4

Author Comment

by:pdd
ID: 9874952
i did expected an error.

i didn't thougth that the negating will work on a new line like this
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Mail Not Sent 6 42
windows 10 bash shell 4 35
How to remove decimals from calculation amount 8 24
Change password through link 1 12
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now