arnaud-lb / php-memory-profiler

Memory profiler for PHP. Helps finding memory leaks in PHP scripts.
MIT License
870 stars 51 forks source link

Usage clarification #14

Closed remicollet closed 3 years ago

remicollet commented 7 years ago

From README.md, usage is extension=memprof.so

$ php -n -d extension=modules/memprof.so -v
PHP 7.0.15 (cli) (built: Jan 17 2017 16:26:45) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

But from code both zend_extension and zend_module_entry are present, so can also be loaded using zend_extension=memprof.so

$ php -n -d zend_extension=$PWD/modules/memprof.so -v
PHP 7.0.15 (cli) (built: Jan 17 2017 16:26:45) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with memprof v2.0.0, Copyright (c) 2013, by Arnaud Le Blanc

Please clarify usage (and perhaps, clean uneeded code)

arnaud-lb commented 7 years ago

Hi

Originally the extension required to be loaded as a zend extension, but this is not required anymore. The zend_extension is kept here for backwards compatibility, and the only thing it does is to load the php extension. This may be removed now, I guess.