Imagine you are the lead PHP programmer for a small retailer. Describe
the difference between passing a parameter to a function by value versus
by reference to newly hired developers. Provide an example of each to
support your response.
passing a parameter by value makes the copy of the original parameter to be sent and stores the value of this copied value into the variable of function being called. When the function where parameter is passed exits its instructions, the copy of the variable is destroyed and no change it done to the original value of the variable. for example:
Sort( int x);
here sort is a function called where x is the parameter passed by value, now consider the implementation of sort function:
Sort( int p )
when sort will complete itself, the copy of x which will be stored in p will be destroyed and original value of x remains as it is.