Solved

why no error ?

Posted on 2003-12-03
8
218 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

724 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