[PHP-DEV] Java and $ (was: Re: [PHP-DEV] Re: ClassHints and NULL)

2004-06-18 Thread Timm Friebe
On Fri, 2004-06-18 at 21:43, Andrei Zmievski wrote: [...] > Wow. When did Java get $ for variables? It already has:) $ cat Dollar.java public class Dollar { public static void main(String[] args) { String $str= "Hello"; System.out.println($str); } } $ /usr/local/jdk1.4.2/bin/javac Do

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Andrei Zmievski wrote: abstract class BasePeer { // ... public static function doDelete(Criteria $criteria, Connection $con) { // ... } } class AuthorPeer extends BasePeer { public static function doDelete(Criteria $criteria, $con = null) { if ($con === null) { $con = Transaction::

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Andrei Zmievski
On Fri, 18 Jun 2004, Hans Lellelid wrote: > abstract class BasePeer { > > // ... > public static function doDelete(Criteria $criteria, Connection $con) { >// ... > } > > } > > class AuthorPeer extends BasePeer { > > public static function doDelete(Criteria $criteria, $con = null) {

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Hi Marcus, Marcus Boerger wrote: Hello Hans, Friday, June 18, 2004, 9:15:47 PM, you wrote: Of course, namespaces are more important than anything ;) hehe, could you live with packages? Probably! yeah :) -- what's the difference? Are namespaces more like what's implement in C#/.NET (i.e. no nece

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Marcus Boerger
Hello Hans, Friday, June 18, 2004, 9:15:47 PM, you wrote: >>>Of course, namespaces are more important than anything ;) >> >> >> hehe, could you live with packages? > Probably! yeah :) -- what's the difference? Are namespaces more like > what's implement in C#/.NET (i.e. no necessary correspon

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Marcus Boerger wrote: Here is a slightly related example from my code [] -- and it would be nice if I could use optional paramters w/ typehints. IMO thats the only valid point you brought up here. Another thing missing is that in derived classes the typehints should be able to accept superclas

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Marcus Boerger
Hello Hans, Friday, June 18, 2004, 4:41:08 PM, you wrote: > Hi, > Marcus Boerger wrote: >> Last but not least we know already that a lot of people like to >> be able to handle both instanceof or null with typehints. But at >> the moment we have no solution that can go into PHP 5.0. However >> i

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-18 Thread Hans Lellelid
Hi, Marcus Boerger wrote: Last but not least we know already that a lot of people like to be able to handle both instanceof or null with typehints. But at the moment we have no solution that can go into PHP 5.0. However i am quite sure we will address this for 5.1. I'm glad this issue will be re-ev

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-17 Thread Marcus Boerger
Hello Ray, Thursday, June 17, 2004, 3:23:10 PM, you wrote: > I understand your point, however, this is the way that other languages > behave and its a feature that i consider to be very necessary and > timesaving. In this case PHP behaves like Java very only one pass by reference is allowed.

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-17 Thread Ray Hilton
I understand your point, however, this is the way that other languages behave and its a feature that i consider to be very necessary and timesaving. My understanding was that Typehinting exists to save having to do such if-else clauses all the time, since 99.9% of the time, you will expect an

Re: [PHP-DEV] Re: ClassHints and NULL

2004-06-16 Thread Marcus Boerger
Hello Ray, Wednesday, June 16, 2004, 4:26:26 PM, you wrote: > Hi all, [] - NOTHING stops you from passing NULL to functions. - Typhints are a shortcut for an 'instanceof'`test - now try NULL instanceof stdclass: php-cvs $ php -r 'var_dump(NULL instanceof stdclass);' bool(false) - what