Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

why no error ?

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

<?php

!
$variable;

?>
0
Comment
Question by:pdd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
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 75 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

604 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