Skip to main content

PHP variable scope part2



Code:

<?php

/*

variable scope



local variable

global variable

static variable

function parameter

*/



$x = 10;

function xyz(){

//global $x;

$z = 10 + $GLOBALS["x"];

print $z;



}

xyz();


Comments