rfc:calltimebyref

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
Next revisionBoth sides next revision
rfc:calltimebyref [2008/05/21 13:03] sfoxrfc:calltimebyref [2008/05/21 13:29] sfox
Line 9: Line 9:
  
 This RFC aims to clarify the situation with call-time pass-by-ref in PHP 5.3. This RFC aims to clarify the situation with call-time pass-by-ref in PHP 5.3.
 +
 +
  
 ===== History ===== ===== History =====
Line 18: Line 20:
 Even in the current php.ini-recommended, the switch is attributed only to 'Code cleanliness'. The full entry in the heading about changed settings reads: Even in the current php.ini-recommended, the switch is attributed only to 'Code cleanliness'. The full entry in the heading about changed settings reads:
  
 +<code>
 ; - allow_call_time_pass_reference = Off     [Code cleanliness] ; - allow_call_time_pass_reference = Off     [Code cleanliness]
 ;     It's not possible to decide to force a variable to be passed by reference ;     It's not possible to decide to force a variable to be passed by reference
 ;     when calling a function.  The PHP 4 [sic] style to do this is by making the ;     when calling a function.  The PHP 4 [sic] style to do this is by making the
 ;     function require the relevant argument by reference. ;     function require the relevant argument by reference.
 +</code>
 +
 +In fact, allowing values to be passed by reference is the default behaviour in PHP, and has been from PHP 4.0 beta right up to PHP 5.3.
  
-In fact, allowing return values by reference is the default behaviour in PHP, and has been from PHP 4.0 beta right up to PHP 5.3. 
  
 ===== Reality Check ===== ===== Reality Check =====
  
-In some circumstances, on some platforms, returning values by reference can actually speed up your code. In most cases, though - and for all when it comes to large arrays - it carries a performance penalty. If you make use of by-ref for performance reasons on a given platform, that optimization will not be portable.+In some circumstances, on some platforms, passing values by reference can actually speed up your code. In most cases, though - and for all when it comes to large arrays - it carries a performance penalty. If you make use of by-ref for performance reasons on a given platform, that optimization will not be portable. 
  
 ===== Future ===== ===== Future =====
  
-The directive is completely gone from CVS HEAD [3]. The effect of this originally was that a new-to-many ''E_STRICT'' would be thrown when values are returned by reference. However, it's been moved to ''E_DEPRECATED'' recently. In either case, it will no longer be possible to turn the warning off.+The directive is completely gone from CVS HEAD [3]. The effect of this originally was that a new-to-many ''E_STRICT'' would be thrown when values are passed by reference. However, it's been moved to ''E_DEPRECATED'' recently. In either case, it will no longer be possible to turn the warning off.
  
 ===== Proposal ===== ===== Proposal =====
rfc/calltimebyref.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1