Re: Help with typecasting by default in the function parameter list

From: Date: Tue, 21 Nov 2006 14:53:02 +0000
Subject: Re: Help with typecasting by default in the function parameter list
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-244961@lists.php.net to get a copy of this message
Jared Farrish wrote: > Is this legal? > Note where the typecasting occurs: In the function parameter > list, before the variable. > > <code> > function doSomething( (int) $int1, (int) $int2 ) { > //blah blah > } > </code> > > This would take the place of: > > <code> > function doSomething($int1, $int2) { > $int1 = (int) $int1; > $int2 = (int) $int2; > } > </code> > > Is this possible? have you taken 5 seconds to run the code and find out? >

« previous php.general (#244961) next »