No warning or error for variable not declared

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

No warning or error for variable not declared

Post by anjanesh »

I've another problem. A file contain just this :

Code: Select all

<?php
print($asd);
?>
This is not giving any warning or error saying that $asd is not declared. It used to before. What do I have to change in php.ini

Thanks
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

You are not reporting all errors, something like "display_errors = On" in the php.ini file. Or you can just set it up in your script using:

Code: Select all

error_reporting(E_ALL);
@ini_set('display_errors', '1');
And this will show all errors/warnings.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

[RESOLVED]

Post by anjanesh »

Yes. I got it.
Thanks a lot for your help.
Post Reply