Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

WTF PHP

Name: php is fucking shit 2012-02-21 8:26

Example #1 Using global

<?php
$a = 1;
$b = 2;

function Sum()
{
    global $a, $b;

    $b = $a + $b;
}

Sum();
echo $b;
?>


 The above script will output 3. By declaring $a and $b global within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function.

Name: Anonymous 2012-02-21 16:13

>implicit local declarations
>2012

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List