reference

PHP Logo

PHP Question: Pass By Reference

19th April 2011 - 2 minutes read time

Question

Consider the following:

function doSomething(&$val) {
    $val++;
}

$a = 1;
doSomething($a);

What does the variable $a now equal?