rfc:prototypecasting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:prototypecasting [2012/02/28 12:00] – [Request for Comments: Prototype Argument Type Casting] daveyrfc:prototypecasting [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 19: Line 19:
 <code php> <code php>
 <?php <?php
-function addProfile( (string) $name, (int) $age, (float) $salary) { +function addProfile( (string) $name, (int) $age, (float) $heightInMeters) { 
 +    echo gettype($name);   // "string" 
 +    echo gettype($age);    // "integer" 
 +    echo gettype($heightInMeters); // "double"
 } }
 +
 +addProfile("Davey Shafik", "27", "1.77");
 ?> ?>
 </code> </code>
rfc/prototypecasting.1330430415.txt.gz · Last modified: 2017/09/22 13:28 (external edit)