function changeValueOfReference(&$input) { echo '----> changeValueOfReference ' . PHP_EOL; _mem(); xdebug_debug_zval_stdout('input'); $input = sizeof($input); _mem(); // cant no use _var for input since function scope will change xdebug_debug_zval_stdout('input'); echo '<---- ' . PHP_EOL; }
function _var($name) { echo " -- \${$name} --" . PHP_EOL; xdebug_debug_zval_stdout($name); echo PHP_EOL; }
/** * This function displays structured information about one or more variables that includes its type, * value and refcount information. * Arrays are explored recursively with values. * The difference with xdebug_debug_zval() is that the information is not displayed through a web server API layer, * but directly shown on stdout (so that when you run it with apache in single process mode it ends up on the console). * @return void */ public function debugZvalStdout() { xdebug_debug_zval_stdout(); }