LoginSignup
0
0

More than 5 years have passed since last update.

PHPのstdClassオブジェクトのプロパティを確認したいが、メモリ不足でエラーになる場合

Last updated at Posted at 2019-01-23

通常は、get_object_vars($obj)でオブジェクトの中身が配列で取得できる。

問題は、これで下記のようなエラーが発生する場合。

Allowed memory size of xxxxxxxxx bytes exhausted

そんなときは、下記でできるかも。(自分はできた。)

json_decode(json_encode($obj), true)

参考: https://stackoverflow.com/a/18576902/1646699

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0