There is a method in PHP called `extract` which does exactly what I want to do here. Say I have an object that looks like this:

```
var data = {
    name: "Olly"
    age: 19
};

```

I want to run a method like `extract(data)` so that I can then access the properties in that object by just using `name` and `age`, instead of `data.name` and `data.age`.

I've done a bit of Googling and couldn't find anything.