PHP has only one use for the var keyword. And thats in a member declaration for PHP4 objects.
Using var in a function will cause a syntax error. What you're reading is referring to scope.
PHP Code:
<?php
$hello = 'Hello';
function helloAlter()
{
$hello = 'world';
}
print $hello . "\n";
helloAlter();
print $hello . "\n";
?>
Output:
The options for scope are to pass the desired value to change as a reference variable, or to use the dangerous global keyword. Globalizing is a last resort since it kills functions should the original variable be removed. This results in undesirable and unpredictable behaviour. The only time global should actually be used is when you're using a callback handler for a predefined PHP function that requires a specific signature, but you need to add additional variables (such as setting an error handler function that requires an open data source).