|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-11 02:03 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
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) ].