Hello everyone,
I'm on w3schools getting used to PHP, I'm having issue getting around the following:
<!DOCTYPE html>
<html>
<body>
<?php
function myTest()
{
static $x=0;
echo $x;
$x++;
}
myTest();
myTest();
myTest();
?>
</body>
</html>
The result being 012?
if I take away one of the myTest(); its becomes 01?
Why on earth is this happening and what does the $x++ do? I've searched high and low for an answer to no avail.