News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Derick Rethans' Blog:
Scalar Type Hinting and DB Design Slides
June 17, 2006 @ 18:52:04

Derick Rethans has two blog posts for us today, the first details a patch he created which allows us to use type hints for all variable types in PHP.

Derick himself admits that its probably not the best approach:

The patch is most likely not the best way of implementing this either, and I am also not sure if this patch should be applied to PHP's CVS at all.

He offers the following as an example of how this would be used:

function foo2( integer $i, float $f, bool $b ) { }
foo2( 'string', 42, 49.9 );

The example above should show:

Catchable fatal error: Argument 1 passed to foo2() must be of type integer, string given, called in /tmp/test.php on line 16 and defined in /tmp/test.php on line 12

Derick also posted his Database Design Slides from his talk earlier this year at php|architects php|tek

0 comments voice your opinion now!
database design scalar typehints database design scalar typehints


blog comments powered by Disqus

Similar Posts

Community News: "Elephant in the Room" Podcast Launched (Episode 1)

PHPMaster.com: Bulletproofing Database Interactions with PHPUnit's Database Extension

NetTuts.com: Understanding and Working with Data in WordPress

Hari KT's Blog: Is there a design flaw for the Components or Packages made by Symfony2 and ZF2

The Bakery: Checking for duplicate records (unique record)


Community Events





Don't see your event here?
Let us know!


language voicesoftheelephpant introduction laravel podcast composer tool security version framework community conference interview release symfony artisanfiles series list opinion library

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework