Jump to content

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.

Edited by AbraCadaver
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.