This code produces the result as 56.
function x ($y) { function y ($z) { return ($z*2); } return($y+3); } $y = 4; $y = x($y)*y($y); ech
(4+3)*(4*2) == 56
Note that PHP doesn't really support "nested functions", as in defined only in the scope of the parent function. All functions are defined globally. See the docs.