Jyxo\Spl\Object::toArray PHP Method

toArray() public method

Converts an object to an array
public toArray ( ) : array
return array
    public function toArray() : array
    {
        $values = [];
        foreach ((array) $this as $key => $value) {
            // Private and protected properties have ugly array key prefixes which we remove
            $key = preg_replace('~^.+\\0~', '', $key);
            $values[$key] = $value;
        }
        return $values;
    }