Question: I want to test database performance and understand how database throughput (in terms of transactions per second) depends on disk properties like IO latency and variation, write queue length, etc. Ideally, I need a simulator that can be mounted as a disk volume and has a RAM disk inside wrapped into a controller that allows to set desired IO profile in terms of latency, throughput, stability etc. I wonder is there such a simulator for Linux or what is the best way to write it in C?

Answer: 
You declare globals inside function scope.

Try to declare them at class scope:

```
class Someclass{

    function topFunction()
    {       

        function makeMeGlobal($var)
        {
            global $a, $b;

            $this->a = "a".$var;
            $this->b = "b".$var;
        }

        makeMeGlobal(1);    
        echo $this->a . "<br>";
        echo $this->b . " <br>";

        makeMeGlobal(2);    
        echo $this->a . "<br>";
        echo $this->b . "<br>";
    }
}

```
you are creating the global variables inside the function, try creating them in the class scope rather than the function. that should work.