Jump to content
Killersites Community
Sign in to follow this  
Biske94

Statements Vs Functions

Recommended Posts

What is the difference between statements and functions?

For instance why dont we type include('somefile.php') or echo('Hello World') ? 

Thanks! :)

Share this post


Link to post
Share on other sites

Are you talking about the difference between language construct and functions in PHP?

I don't exactly understand the difference but I found a helpful post on stackoverflow.

https://stackoverflow.com/questions/1180184/what-is-the-difference-between-a-language-construct-and-a-built-in-function-in

Supposedly, language constructs can't be used in call backs. It's the second post by Pascal Martin, he has example code.

Share this post


Link to post
Share on other sites

Functions do something ... they process. You can think of functions as being like mini programs. 

Statement just state something .... there is no processing. That is a non nerd way of describing it. Think of a statement like a verbal statement. 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×