43
Mon Mar 04 2024 01:57:37 GMT+0000 (Coordinated Universal Time)
Saved by
@codewarrior
$variable = 10; // Global variable
function shadowingExample() {
$variable = 5; // Local variable with the same name
echo $variable; // Output: 5
}
shadowingExample();
echo $variable; // Output: 10 (global variable is not modified)
content_copyCOPY
Comments