?
Solved

why no error ?

Posted on 2003-12-03
8
Medium Priority
?
219 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
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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.
Suggested Courses

771 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