function y(&$id){ ++$id; } // pass by reference
function z($id){ ++$id; } // pass by value
$id=1;
y($id); echo $id; // 2
z($id); echo $id; // 2
y($id); echo $id; // 3
z($id); echo $id; // 3
// Turn off error reporting
// error_reporting(0); // E_ALL
function x($a,$b,$c=0){ return true; }
echo x(5,6,7); // php5 : ok
echo x(5,6); // php5/php7 : ok
try {
echo x(5); // Warning || Fatal error
//} catch (Exception $e) {
} catch (Error $e) {
//echo $e->getMessage();
}
// php5 - Warning: Missing argument 2
// php7 - Fatal error: Uncaught ArgumentCountError: Too few arguments to function x(), 1 passed
// function &get_fast_modinfo(&$course, $userid=0) {
//
$course=1; $cm=1; $glossary=1; $entry=1; $mode='1'; $hook='1'; $displayformat=1; $ratings =1;
function glossary_print_entry($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons = 1, $displayformat = -1, $ratings = NULL, $printview = false) { }
glossary_print_entry($course, $cm, $glossary, $entry, "", "", 0); // mod/glossary/lib.php
glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,false,true); // mod/glossary/print.php
glossary_print_entry($course, $cm, $glossary, $entry, $mode, $hook,1,$displayformat,$ratings) // mod/glossary/view.php