Reply to Re: Passing null for a class-typed argument renders catchable error ?!?

Your name:

Reply:


Posted by Michael Fesser on 01/13/08 21:58

..oO(Peter Pei)

>buggy. inconsistent lang design

Wrong. It's not inconsistent, it's just not properly documented.
The behaviour is perfectly logical and quite useful if you know it:

public function foo(TBar $obj) {}

=> You must pass a TBar object.

public function foo(TBar $obj = NULL) {}

=> The parameter is optional, but if you pass something, it must be an
object of class TBar.

That's how I want it.

Micha

PS: Please learn to quote properly. Your posting alone taken out of
context is meaningless.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация