Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics (Retired) PHP Datatypes PHP Constants

No quotes for numbers constant

In this video Paulk doesn't use quotes for the numbers while for the text yes. Why?


define("YEAR", 2015);
define("JOB_TITLE", "Teacher")
define("MAX_BADGES", 150000);


2 Answers

Samuel Webb
Samuel Webb
25,370 Points

If he would have used quotes on the numbers they would be a string(type) instead of an integer(type). Booleans and Floats are two other types you wouldn't use quotes for.

Strings would be used for a word or sentence. While integers and floats(decimal numbers) would be used for math and other things you would use a number for.

Thank you Samuel!