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
Last revisionBoth sides next revision
rfc:prototypecasting [2012/02/28 11:59] – [Introduction] daveyrfc:prototypecasting [2012/02/28 12:04] – Be more explicit about casting behavior davey
Line 1: Line 1:
-====== Request for Comments: Prototype Argument Type Casting ======+====== RFC: Prototype Argument Type Casting ======
   * Version: 0.1   * Version: 0.1
   * Date: 2012-02-27   * Date: 2012-02-27
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.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1