Example #1
0
<html>
<head>

</head>
<body>
    <?php 
include_once "TernarOperator.php";
include "libraries/functionsLibrary.php";
echo $globalVar . "\n";
$counter = funcWithStaticVariable();
echo $counter . "\n";
?>
</body>
</html>
Example #2
0
    foreach ($arguments as $argument) {
        echo $argument;
    }
}
paramsFunction("hello", "<br/>", 1, "<br/>", true);
function funcWithStaticVariable()
{
    static $counter = 0;
    $counter++;
    return $counter;
}
$result = funcWithStaticVariable();
echo $result . "\n";
$result = funcWithStaticVariable();
echo $result . "\n";
$result = funcWithStaticVariable();
echo $result . "\n";
function funcWithGlobalVariable()
{
    global $globalVar;
    $globalVar = "globalvar на связи!";
}
funcWithGlobalVariable();
echo $globalVar . "\n";
//unset($globalVar);
//echo $globalVar."\n";   // Будет ошибка если раскомментировать
define("MAXSIZE", 100);
echo MAXSIZE;
echo constant("MAXSIZE");
// same thing as the previous line
$привет = "Фывфывфыв";