[TYPO3] danptagcloud - Call-time pass-by-reference has been deprecated;

Stefan Galinski stefan.galinski at frm2.tum.de
Wed Nov 28 10:19:53 CET 2007

Bartosz Aninowski wrote:

> Any hint what is wrong?
> Warning: Call-time pass-by-reference has been deprecated; If you would
> like to pass it by reference, modify the declaration of [runtime function
> name](). If you would like to enable call-time pass-by-reference, you can
> set allow_call_time_pass_reference to true in your INI file in
> class.tx_danptagcloud_pi1.php on line 50
> I can enabe allow_call_time_pass_reference  but this is deprecated.
> PHP Version 5.2.5
> TYPO3 4.1.2

Hi Bartosz,

Its only allowed to use variable references in function declarations for the
parameters. Not in their call or in any other situation. The stuff will be
finally removed with PHP6 (5.3?). You can fix it yourself and send the
author a patch or enable the allow_call_time_pass_reference option.

Call time pass by reference is going to be removed… So all of you that are
currently initiating your objects with the reference operator should stop
doing it, although it will be an E_STRICT error, you might still want to
only use it if you must!

$var =& new stdObject(); //current object reference
$var = new stdObject(); //just do this instead :)

Same for such constructs:

## BAD:
function test($a) { return ++$a; }
$a = 0;

## GOOD:
function test(&$a) { return ++$a; }
$a = 0;

Stefan Galinski

More information about the TYPO3-english mailing list