Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Object-Oriented PHP Basics (Retired) Properties and Methods Mid-Course Challenge

Prakhar Patwa
Prakhar Patwa
11,260 Points

its showing my output but showing some notice.

/* Notice: Use of undefined constant common_name - assumed 'common_name' in C:\xampp\htdocs\flavours.php on line 20

Notice: Use of undefined constant flavor - assumed 'flavor' in C:\xampp\htdocs\flavours.php on line 20

Notice: Use of undefined constant record_weight - assumed 'record_weight' in C:\xampp\htdocs\flavours.php on line 20 A Largemouth Bass is an Excellent flavored fish. The world weight is 22 pounds 5 ounces

*/

fish.php
<?php

class Fish {

}

?>

2 Answers

Prakhar

If you are doing this on your local environment, then it has to do with your php.ini file. Inside of that file you can configure how to display errors, warnings, and notices. Notices are fine and don't break the script. Warning are the same. Errors will break the script from functioning so you can choose to only display errors and not warnings and notices. Open your php.ini file and find the error reporting section and change the error reporting line to:

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

Once you do this restart the web server and the notices will disappear. Notices and warning are mostly used to debug scripts and are used mostly in the development environment. I hope this helps you.

Cheers!

Prakhar Patwa
Prakhar Patwa
11,260 Points

ohh thnkx its working