*** artev escribió/wrote (Tue, 12 Aug 2008 23:30:42 +0200):
function pippo($var1, &$var2 = null, $var3 = null) { ....}
>
but if remove &
I not have the erros;
>
I must change sometime in php.ini or can resolve how?
I use php4.x
According to the manual, you must upgrade to PHP 5 or rewrite your
function. PHP 4 doesn't allow the combination of passing by reference and
default values:
According to the manual, you must upgrade to PHP 5 or rewrite your
function. PHP 4 doesn't allow the combination of passing by reference and
default values:
> http://es2.php.net/manual/en/functions.arguments.php
ok so this work only in php5
function pippo($var1, &$var2 = null, $var3 = null) { ....}
but if I write so:
function pippo($var1, &$var2, $var3 = null)
{
if(!&$var2) {&$var2 = null}
.....
}
>According to the manual, you must upgrade to PHP 5 or rewrite your
>function. PHP 4 doesn't allow the combination of passing by reference and
>default values:
>>
>http://es2.php.net/manual/en/functions.arguments.php
>
ok so this work only in php5
function pippo($var1, &$var2 = null, $var3 = null) { ....}
>
but if I write so:
function pippo($var1, &$var2, $var3 = null)
{
if(!&$var2) {&$var2 = null}
....
}
>
I can resolve?
>
if (!$var2) {$var2 = null;}
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attgl obal.net
=============== ===
*** artev escribió/wrote (Wed, 13 Aug 2008 17:18:43 +0200):
ok so this work only in php5
function pippo($var1, &$var2 = null, $var3 = null) { ....}
>
but if I write so:
function pippo($var1, &$var2, $var3 = null)
{
if(!&$var2) {&$var2 = null}
....
}
It's not exactly the same. This way you must call pippo() with at least
$var1 and $var2, so $var2 is no longer optional.
I can think of a couple of tricks but it looks like that the best solution
would be a small redesign.
Il Wed, 13 Aug 2008 18:14:32 +0200, Álvaro G. Vicario ha scritto:
*** artev escribió/wrote (Wed, 13 Aug 2008 17:18:43 +0200):
>ok so this work only in php5
>function pippo($var1, &$var2 = null, $var3 = null) { ....}
>>
>but if I write so:
>function pippo($var1, &$var2, $var3 = null)
>{
>if(!&$var2) {&$var2 = null}
>....
>}
>
It's not exactly the same. This way you must call pippo() with at least
$var1 and $var2, so $var2 is no longer optional.
function pippo($var1, &$var2 = null, $var3 = null) { ....}
but also so $var2 is no longer optional ?
>According to the manual, you must upgrade to PHP 5 or rewrite your
>function. PHP 4 doesn't allow the combination of passing by reference and
>default values:
>>
>http://es2.php.net/manual/en/functions.arguments.php
>
>ok so this work only in php5
>function pippo($var1, &$var2 = null, $var3 = null) { ....}
>
>but if I write so:
>function pippo($var1, &$var2, $var3 = null)
>{
>if(!&$var2) {&$var2 = null}
>....
>}
>
>I can resolve?
Comment