<?php // RAY_temp_bitlab.php
error_reporting(E_ALL);
function top()
{
$x=1;
function inside($y)
{
echo ($y+2)."<br/>";
}
inside(2);
echo $x.' ';
}
top();
echo inside(5);
top();
echo inside(6);
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
Open in new window
When I try using break in echo line of inside function it will display like:4 //Here 4 is the first function which was passed value by reference in inside(2) to inside($y);
1 7 //Now the one is default value or value by value $x=1 and 7 is from outside of top function inside(5) which is again value by reference in inside($y) function
So you can understand that you can pass value in function by reference or by value here you already used.
For your reference you can see in:
http://www.php.net/manual/en/functions.arguments.php