Re: [RFC] Type hints

From: Date: Sun, 09 May 2004 10:52:18 +0000
Subject: Re: [RFC] Type hints
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-9749@lists.php.net to get a copy of this message
On Sun, 2004-05-09 at 06:46, Andi Gutmans wrote: > At 01:42 PM 5/9/2004 +0300, Stanislav Malyshev wrote: > >AG>>sure if this is the perfect solution: > >AG>>nullable MyClass $a = 5 > > > >I must be missing something, but why typehinted variable should have any > >default except for null anyway? If someone says "I want only MyClass > >here!", why he should be able to put 5 there? I think I mentioned something pretty close to this (maybe I used forceable instead of nullable). However, it's not really obvious to me why you should be allowed to do the default assignment in this case. Can someone either give a quick example as to why I would want to assign a default value like this? Other than that, +1 on nullable in concept. John -- -=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=- John Coggeshall http://www.coggeshall.org/ The PHP Developer's Handbook http://www.php-handbook.com/ -=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=-

« previous php.internals (#9749) next »