rfc:typecheckingweak

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:typecheckingweak [2009/07/13 06:31] zeevrfc:typecheckingweak [2009/07/13 07:23] – Remove a note which turns out to be more confusing than useful zeev
Line 48: Line 48:
 bar('whatever', 17.5);  // argument will be converted to a string '17.5' before being passed to bar() bar('whatever', 17.5);  // argument will be converted to a string '17.5' before being passed to bar()
 foobar(17.5);           // will fail (scalar value cannot be passed by reference) foobar(17.5);           // will fail (scalar value cannot be passed by reference)
-$x=17.5;  foobar($x);   // $x will be converted to 17(int), and then passed to foobar()+$x=17.5;  foobar($x);   // $x will be converted to 17(int), and then passed to foobar(); $x remains 17(int) after the call to foobar()
 </code> </code>
  
Line 57: Line 57:
   - Emit an error or throw an exception.   - Emit an error or throw an exception.
  
-**Note:**  In step 2, if the argument is designated as a pass-by-reference argument - the conversion will apply to the variable being passed.  This is consistent with the expectation that arguments passed by reference may be modified by the function they're sent to. 
  
  
rfc/typecheckingweak.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1