Get the reference count of an object in PHP?

后端 未结 5 2298
终归单人心
终归单人心 2021-01-01 18:26

I realize the knee-jerk response to this question is that \"you dont.\", but hear me out.

Basically I am running on an active-record system on a SQL, and in order to

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 19:04

    It seems like the best answer was still getting the reference count, although debug_zval_dump and ob_start was too ugly a hack to include in my application.

    Instead I coded up a simple PHP module with a refcount() function, available at: http://github.com/qix/php_refcount

提交回复
热议问题