#30211 [Opn]: Method argument type-mismatch returns error with method's line-number

From: Date: Thu, 23 Sep 2004 18:30:25 +0000
Subject: #30211 [Opn]: Method argument type-mismatch returns error with method's line-number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66611@lists.php.net to get a copy of this message
ID: 30211 Updated by: helly@php.net -Summary: Method argument type-mismatch returns error with wrong line-number Reported By: m dot leuffen at i-line dot net Status: Open -Bug Type: Class/Object related +Bug Type: Feature/Change Request PHP Version: 5.0.1 New Comment: The line number is not wrong it is simply the method's line number instead of the caller's line number you expected. So this is a feature request. Previous Comments: ------------------------------------------------------------------------ [2004-09-23 16:55:49] m dot leuffen at i-line dot net Description: ------------ Hi, if you define a ObjectType in Argument-List of a Method, the Line-Number (in Error-Message) points to the Method and not to the Line the argument is set. This makes debugging very hard ;-) Bye, Matthias Reproduce code: --------------- 01: <?PHP 02: class Test { 03: 04: public static function testmethod (Test $obj) { 05: } 06: } 07: 08: $string = "I'm a string"; 09: Test::testmethod ($string); 10: ?> Expected result: ---------------- Fatal error: Argument 1 must be an object of class Test in test.php on line 9 Actual result: -------------- Fatal error: Argument 1 must be an object of class Test in test.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30211&edit=1

« previous php.bugs (#66611) next »