Solved

why no error ?

Posted on 2003-12-03
8
214 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

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…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

777 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