Jump to content

PHP Procedures?


mtr4

Recommended Posts

I'm a teacher in the UK and one of our exam boards have said 

 

* know when the use of procedures or functions would make sense

* know how to write and use their own simple procedures and functions

 

The first part of it is easily understandable as there is the theory side of things for procedures, its writing a procedure in PHP which has me stumped

 

Matt

Link to comment
https://forums.phpfreaks.com/topic/281432-php-procedures/#findComment-1446134
Share on other sites

I'm a teacher in the UK and one of our exam boards have said 

 

* know when the use of procedures or functions would make sense

* know how to write and use their own simple procedures and functions

 

The first part of it is easily understandable as there is the theory side of things for procedures, its writing a procedure in PHP which has me stumped

 

Matt

 

In PHP there is function() which does what traditional functions do and what traditional procedures or sub-routines do.  The normal distinction is that functions take arguments and based on those return a value.  Sub-routines or procedures normally don't return a value but instead carry out an action like modifying a table or sending an email etc.  In PHP functions are used for both.  In VB or VBA there are functions that return a value and subs that perform an action.  In MySQL I believe this is roughly the same, stored procedure vs. stored function.

Link to comment
https://forums.phpfreaks.com/topic/281432-php-procedures/#findComment-1446137
Share on other sites

Personally, I'd take that as they have to write their code which interacts with the functions they've defined. As Abra said it's terminology across languages. 

 

I have a colleague who uses the language cobol and he calls function sub-routines or procedure.

 

I think it's only databases that make the distinction between procedures and functions.

Link to comment
https://forums.phpfreaks.com/topic/281432-php-procedures/#findComment-1446139
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.