All Projects → laruence → Php Valgrind

laruence / Php Valgrind

A PHP Valgrind tool

Programming Languages

c
50402 projects - #5 most used programming language

php-valgrind

A PHP valgrind tool, it can be used to toggle collect in PHP scripts

<?php
$a =array();
callgrind_toggle();
for ($i=0;$i<100;$i++) {
   $a[$i] = 2;
}
callgrind_toggle();
callgrind_dump();  //This is optional in this case

then you must run valgrind with auto-toggle and auto-instr both off

$valgrind --tool=callgrind --collect-atstart=no --instr-atstart=no php /tmp/1.php

//Output:
...
==3533== Events    : Ir
==3533== Collected : 2361260
==3533==
==3533== I   refs:      2,361,260

then you will get a callgrind.out.*, let's open it with qcachegrind(or kcachegrind, callgrind_annotate)

callgrind.out

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].