Determine elements of a PHP expression
===

Expressions like these:

- `$var`

- `function()`

- `$object->getProperty($var);`

- `$object->property`

- `$object->property->function($var)`

- `class::function()`

etc.

I want to get a list of all elements and what types they are. So for example:

`$object->property->function($var)`

the elements are:

- $object - variable
- property - property
- function() - function
- $var - variable

Is there an easy way to do this?