This can easily be replaced with a cast of any object to an array:

```php
class foo
{
  public $a = 1;
  public $b = 2;
  public $c = 'bar';
}
print_r( (array)new foo );
```

```
Array
(
    [a] => 1
    [b] => 2
    [c] => bar
)
```

Am I missing anything ?