"; // Pass the variable by value to the AddNineteen_value() function. AddNineteen_value($Variable); // Display the variable value after passing it by value. echo ""; // Pass the variable by reference to the AddNineteen_reference() function. AddNineteen_reference($Variable); // Display the variable value after passing it by reference. echo ""; // Function to add 19 to the received variable; // the function receives the variable value. function AddNineteen_value($MyVariable) { $MyVariable+=19; } // Function to add 19 to the received variable; // the function receives a reference to the variable // (note the ampersand before the variable name). function AddNineteen_reference(&$MyVariable) { $MyVariable+=19; } ?>
Step Variable Value
Initial value $Variable
After passing by value $Variable
After passing by reference $Variable