ID:               32380
 User updated by:  freebsd at akruijff dot dds dot nl
-Reported By:      freebsd at dds dot nl
+Reported By:      freebsd at akruijff dot dds dot nl
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: FreeBSD
 PHP Version:      5.0.3
 New Comment:

Correcting e-mail


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

[2005-03-20 01:16:57] freebsd at dds dot nl

Changed to feuture request

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

[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