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

Ali Ware
Ali Ware
1,719 Points

Primitive Variables in PHP

I'm working my way through the Beginning PHP course and ran across the term "Primitive Variable" in the notes for "Variables in PHP." It's not defined in the video and I can't find a clear answer by digging through a Google search. It seems to be some kind of umbrella term for other data types, but that's all I'm getting.

Any insight would be appreciated!

1 Answer

John Lack-Wilson
John Lack-Wilson
8,181 Points

I'm not sure what a "Primitive Variable" is, can't say I've heard of that. But a Primitive Data Type are the basic data types allowed by a programming language, for example in PHP we have:

  • String
  • Integer
  • Float
  • Boolean

There may be others that I have not listed. My assumption would be that "Primitive Variable" refers to a variable that is assigned a Primitive Data Type. For example:

$name = "Ali";

If my assumption is correct, then the above $name variable would be a primitive variable as it contains a String.