Is there a way I get the size of a PHP variable in bytes?

前端 未结 4 1950
梦如初夏
梦如初夏 2021-01-02 00:41

I currently have a PHP CLI script using Zend Framework extensively which seems to be using a ever larger amount of memory as it runs. It loops through a large set of models

4条回答
  •  死守一世寂寞
    2021-01-02 01:10

    Here is a code snippet I found at weberdev

    
    

    It gets the size of the given array in bytes. Is this what you meant?

提交回复
热议问题