[TYPO3-dev] Photo galleries
Franz Holzinger
franz at fholzinger.com
Fri Mar 24 08:43:31 CET 2006
Hello Tapio,
>
> For older Typo3 was Photo marathon.
> Now there difficult to find a good corresponding plugin.
>
> Most makes this kind of error using typo3 3.8.1.
> How to fix this:
>
> Warning: Call-time pass-by-reference has been deprecated - argument
> passed by value; 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. However, future versions may not support this
> any longer. in
> /var/www/html/julkinen/typo3conf/ext/jm_gallery/pi1/class.tx_jmgallery_pi1.php
> on line 89
>
> This concerns also some other corresponding plugins. Might need some
> generic instructions for plugins designers to avoid this?
> $this->HTML = new tx_jmgallery_pi1_misc ($this->conf, &$this->cObj);
> /**
> * default Constructor
> */
> function tx_jmgallery_pi1_misc ($conf, &$cObj){
> $this->cObj = &$cObj;
> $this->conf = $conf;
> }
This error comes when you use PHP5 where this warning message will be
produced if you call a function with a reference operator before a
parameter.
see http://www.phpbar.de/w/Parameter
old way which has been possible in the past:
function foo (&$bar ) { ++$bar; }
$number = 5;
foo( &$zahl );
---------------------------------------
new:
function foo ( & $bar ) { ++$bar; }
$number = 5;
foo( $zahl );
So the line needs to be changed to
$this->HTML = new tx_jmgallery_pi1_misc ($this->conf, $this->cObj);
The reference parameter shall only be in the function definition. It
will behave the same.
----------
A similar problem will arise when someone changes the function parameter
to be a reference:
Change
function foo ($bar ) { ++$bar; }
to
function foo (&$bar ) { ++$bar; }
foo( 5 );
This will not work any more. So all function calls need to be veryfied.
- Franz
More information about the TYPO3-dev
mailing list