Re: [RFC] Type hints

From: Date: Sun, 09 May 2004 15:55:19 +0000
Subject: Re: [RFC] Type hints
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-9763@lists.php.net to get a copy of this message
Hello Andi, Sunday, May 9, 2004, 12:39:15 PM, you wrote: > The following (Zeev's idea) is much simpler and nicer, but I'm not 100% > sure if this is the perfect solution: > nullable MyClass $a = 5 > Ideas/comments? I think this is probably the best idea so far. BUT it is very hard to implement :-( A working patch can be found here: http://somabo.de/php/ext/ze2/ze2-type-hints-20040509.diff.txt (Patch also contains two new tests) Look at it in deatil, you'll dislike it! But i tried several other ways and couldn't get anything else to work. I trued to do it with two subrules one for nullable and one for the typehint and it didn't work because somehow the parser gets confused on that (to me this looks like a bison error). And even a full blowup of the parameter parsing rule didn't work. I tried valgrind on it and it seemed to be happy. But i am nearly sure there is a memory leak somewhere. If not then there should be an error in the way it was implemented before. If you are interested in this patch i'll have a deeper look. But i'd prefer if someone could find a better way to do it. best regards marcus

« previous php.internals (#9763) next »