ID:               32380
 Updated by:       [EMAIL PROTECTED]
 Reported By:      freebsd at akruijff dot dds dot nl
-Status:           Open
+Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: FreeBSD
 PHP Version:      5.0.3
 New Comment:

Error messages have been improved to contain "called in .. declared in
.." long time ago.


Previous Comments:
------------------------------------------------------------------------

[2005-03-20 00:58:35] freebsd at akruijff dot dds dot nl

Description:
------------
Type hinting prevents passing NULL of non related objects as argument.
An error is give on where the function is defined instead of where it
is called. This make it hard to track down the bug, because it could be
called a 100 times from different files, while only one is wrong.


Reproduce code:
---------------
<?php
  class X {
    public function fa() {}
  }

  class Y {
    public function fb() {}
  }

  function f(X $y) {
    $y->fa();
  }

  f(new Y());
?>


Expected result:
----------------
Would like an error on line 14 [   f(new Y()); ]

Actual result:
--------------
Give an erorr on line 11 [ function f(X $y) ].



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32380&edit=1

Reply via email to