View Issue Details

IDProjectCategoryView StatusLast Update
0000618XdebugUsage problems (Wrong Results)public2011-01-10 22:06
Reporterjasonwyz98Assigned Toderick 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionnot fixable 
PlatformLinuxOSUbuntuOS Version10.04
Product Version2.1.0 
Target VersionFixed in Version 
Summary0000618: Xdebug does NOT break when the "break point" is set at the method declaration
DescriptionHi

Basically Xdebug does NOT break when the "break point" is set at the method declaration.

IDE: PhpStorm "http://www.jetbrains.com/phpstorm/"

PHP: PHP 5.3.3 by dotdeb.org

Xdebug Config:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_log="/home/jason/srv/www/test.net/logs/xdebug.log"
xdebug.collect_params=3
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir="/home/jason/srv/www/test.net/Profiles"

Thanks
Steps To Reproducenamespace Tests;

echo PHP_EOL . '' . PHP_EOL;

class Test { // break point here => works

    static public function static_method() { // break point here => does NOT work

        echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works

    }

    public function __construct() { // break point here => does NOT work

        echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works

    }

    public function instance_method() { // break point here => does NOT work

        echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works

    }
}

Test::static_method();

$t = new Test();

$t->instance_method();
TagsDoesn't Break, method declaration
Operating SystemUbuntu 10.04
PHP Version5.3.3

Activities

derick

2011-01-10 22:06

administrator   ~0001644

PHP doesn't see any code on those lines, so there can not be any breakpoint. However, if you want to break on method calls, the debugging protocol implements that. I don't know whether PHPStorm provides that functionality though.:

  1 <?php
  2 namespace Tests;
  3
  4 echo PHP_EOL . '' . PHP_EOL;
  5
  6 class Test { // break point here => works
  7
  8 static public function static_method() { // break point here => does NOT work
  9
 10 echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works
 11
 12 }
 13
 14 public function __construct() { // break point here => does NOT work
 15
 16 echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works
 17
 18 }
 19
 20 public function instance_method() { // break point here => does NOT work
 21
 22 echo PHP_EOL . __FUNCTION__ . PHP_EOL; // break point here => works
 23
 24 }
 25 }
 26
 27 Test::static_method();
 28
 29 $t = new Test();
 30
 31 $t->instance_method();

Finding entry points
Branch analysis from position: 0
Return found
filename: /tmp/bug618.php
function name: (null)
number of ops: 27
compiled vars: !0 = $t
line # * op fetch ext return operands
---------------------------------------------------------------------------------
   2 0 > NOP
   4 1 EXT_STMT
         2 FETCH_CONSTANT ~0 'Tests%5CPHP_EOL'
         3 CONCAT 0000002:0000001 ~0, ''
         4 FETCH_CONSTANT 0000002:0000002 'Tests%5CPHP_EOL'
         5 CONCAT 0000003:0000003 0000002:0000001, 0000002:0000002
         6 ECHO 0000003:0000003
   6 7 EXT_STMT
         8 NOP
  27 9 EXT_STMT
        10 ZEND_INIT_STATIC_METHOD_CALL 'Tests%5CTest', 'static_method'
        11 EXT_FCALL_BEGIN
        12 DO_FCALL_BY_NAME 0
        13 EXT_FCALL_END
  29 14 EXT_STMT
        15 ZEND_FETCH_CLASS :6 'Tests%5CTest'
        16 EXT_FCALL_BEGIN
        17 NEW $7 :6
        18 DO_FCALL_BY_NAME 0
        19 EXT_FCALL_END
        20 ASSIGN !0, $7
  31 21 EXT_STMT
        22 ZEND_INIT_METHOD_CALL !0, 'instance_method'
        23 EXT_FCALL_BEGIN
        24 DO_FCALL_BY_NAME 0
        25 EXT_FCALL_END
  32 26 > RETURN 1

Class Tests\Test:
Function static_method:
Finding entry points
Branch analysis from position: 0
Return found
filename: /tmp/bug618.php
function name: static_method
number of ops: 9
compiled vars: none
line # * op fetch ext return operands
---------------------------------------------------------------------------------
   8 0 > EXT_NOP
  10 1 EXT_STMT
         2 FETCH_CONSTANT ~0 'Tests%5CPHP_EOL'
         3 CONCAT 0000002:0000001 ~0, 'static_method'
         4 FETCH_CONSTANT 0000002:0000002 'Tests%5CPHP_EOL'
         5 CONCAT 0000003:0000003 0000002:0000001, 0000002:0000002
         6 ECHO 0000003:0000003
  12 7 EXT_STMT
         8 > RETURN null

End of function static_method.

Function __construct:
Finding entry points
Branch analysis from position: 0
Return found
filename: /tmp/bug618.php
function name: __construct
number of ops: 9
compiled vars: none
line # * op fetch ext return operands
---------------------------------------------------------------------------------
  14 0 > EXT_NOP
  16 1 EXT_STMT
         2 FETCH_CONSTANT ~0 'Tests%5CPHP_EOL'
         3 CONCAT 0000002:0000001 ~0, '__construct'
         4 FETCH_CONSTANT 0000002:0000002 'Tests%5CPHP_EOL'
         5 CONCAT 0000003:0000003 0000002:0000001, 0000002:0000002
         6 ECHO 0000003:0000003
  18 7 EXT_STMT
         8 > RETURN null

End of function __construct.

Function instance_method:
Finding entry points
Branch analysis from position: 0
Return found
filename: /tmp/bug618.php
function name: instance_method
number of ops: 9
compiled vars: none
line # * op fetch ext return operands
---------------------------------------------------------------------------------
  20 0 > EXT_NOP
  22 1 EXT_STMT
         2 FETCH_CONSTANT ~0 'Tests%5CPHP_EOL'
         3 CONCAT 0000002:0000001 ~0, 'instance_method'
         4 FETCH_CONSTANT 0000002:0000002 'Tests%5CPHP_EOL'
         5 CONCAT 0000003:0000003 0000002:0000001, 0000002:0000002
         6 ECHO 0000003:0000003
  24 7 EXT_STMT
         8 > RETURN null

End of function instance_method.

End of class Tests\Test.

Issue History

Date Modified Username Field Change
2010-09-23 01:11 jasonwyz98 New Issue
2010-09-23 01:13 jasonwyz98 Tag Attached: Doesn't Break
2010-09-23 01:13 jasonwyz98 Tag Attached: method declaration
2011-01-10 22:06 derick Note Added: 0001644
2011-01-10 22:06 derick Status new => resolved
2011-01-10 22:06 derick Resolution open => not fixable
2011-01-10 22:06 derick Assigned To => derick
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)