[xdebug-general] xdebug_get_code_coverage - shows all 1's

From: Sam Keen <sam.sjk[@]gmail.com>
Date: Wed, 17 Jan 2007 12:09:23 -0800

hello, (me again)
Running PHP 5.2.0 on an OSX 10.4.8 PPC.
I just did a cvs install of xdebug v2.0.0RC3-dev

I was wanting to use the xdebug_get_code_coverage function but it
seems to return coverage of '1' for each line no matter what. I even
tried the example but got all 1's

 1 <?php
 2 xdebug_start_code_coverage();
 3
 4 function a($a) {
 5 echo $a * 2.5;
 6 }
 7
 8 function b($count) {
 9 for ($i = 0; $i < $count; $i++) {
10 a($i + 0.17);
11 }
12 }
13
14 b(6);
15 b(10);
16
17 var_dump(xdebug_get_code_coverage());
18 ?>

my result...
0.4252.9255.4257.92510.42512.9250.4252.9255.4257.92510.42512.92515.42517.92520.42522.925

array
  '/Users/sam/Sites/xdebug/index.php' =>
    array
      4 => int 1
      5 => int 1
      6 => int 1
      8 => int 1
      9 => int 1
      10 => int 1
      11 => int 1
      12 => int 1
      14 => int 1
      15 => int 1
      17 => int 1

again, thanks in advance Derick,
Sam Keen

==========
System Darwin sams-powerbook-g4-15.local 8.8.0 Darwin Kernel Version
8.8.0: Fri Sep 8 17:18:57 PDT 2006;
root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh
Build Date Jan 17 2007 10:04:05
Configure Command './configure' '--prefix=/usr/local/php'
'--with-apxs=/usr/sbin/apxs'
'--with-mysqli=/usr/local/mysql/bin/mysql_config'
'--with-mysql=/usr/local/mysql' '--with-curl=/usr/include'
'--with-xsl' '--with-gd' '--with-png-dir=/opt/local'
'--with-jpeg-dir=/opt/local' '--enable-sockets'
'--with-gettext=/opt/local' '--with-zlib-dir=/opt/local'
'--with-config-file-path=/etc' '--with-xml-rpc' '--enable-mbstring'
'--with-iconv' '--enable-memory-limit'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /private/etc/php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety disabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams php, file, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp, unix, udg
Registered Stream Filters string.rot13, string.toupper,
string.tolower, string.strip_tags, convert.*, consumed,
convert.iconv.*, zlib.*

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
   with Xdebug v2.0.0RC3-dev, Copyright (c) 2002, 2003, 2004, 2005, 2006,
by Derick Rethans

    .....

xdebug
xdebug support enabled
Version 2.0.0RC2

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.112 $
GDB - GNU Debugger protocol $Revision: 1.82 $
PHP3 - PHP 3 Debugger protocol $Revision: 1.20 $

Directive Local Value Master Value
xdebug.allowed_clients no value no value
xdebug.auto_trace Off Off
xdebug.collect_includes On On
xdebug.collect_params Off Off
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.idekey root no value
xdebug.manual_url http://www.php.net http://www.php.net
xdebug.max_nesting_level 100 100
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable On On
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir /tmp/xdebug /tmp/xdebug
xdebug.profiler_output_name timestamp timestamp
xdebug.remote_autostart Off Off
xdebug.remote_enable Off Off
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.show_exception_trace Off Off
xdebug.show_local_vars On On
xdebug.show_mem_delta Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir /tmp /tmp
xdebug.trace_output_name crc32 crc32
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 2 2
=============
Received on Wed Jan 17 2007 - 21:09:25 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST