# PHP 检测 空 Object

- Link: https://www.ixiqin.com/2018/09/09/php-to-detect-an-empty-object/
- Published: 2018-09-09T23:32:45+08:00
- Author: 白宦成

```language-
    if (empty((array) $obj)) {
      return 'error';
    }
    ```
