<?php
    // declaring variables
    $x = 7;
    $y = 2; 
    
    function ADD()
    {
        global $x, $y; // here we refer to global variables declared above
        $y = $x + $y;
    }
    
    // call function
    ADD();
    echo $y;
?>