Bug #51495 [Fbk->NoF]: errors using variable variables as function arguments

From: Date: Fri, 13 Apr 2012 21:01:12 +0000
Subject: Bug #51495 [Fbk->NoF]: errors using variable variables as function arguments
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-169563@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=51495&edit=1

 ID:                 51495
 Updated by:         nikic@php.net
 Reported by:        marco at digitaldruid dot net
 Summary:            errors using variable variables as function
                     arguments
-Status:             Feedback
+Status:             No Feedback
 Type:               Bug
 Package:            Variables related
 Operating System:   linux/windows
 PHP Version:        5.3.2
 Block user comment: N
 Private report:     N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.




Previous Comments:
------------------------------------------------------------------------
[2010-05-12 16:16:29] mike@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------
[2010-04-08 09:46:47] marco at digitaldruid dot net

Please note that the arguments of function mostra_menu_date are NOT passed by reference, so I think
there should be the same behaviour when using ${"inizioperiodo".$num1} or $inizioperiodo
as an argument, if they contain the same value.

------------------------------------------------------------------------
[2010-04-07 13:29:27] marco at digitaldruid dot net

Description:
------------
This problem happens with php 5.3, on 5.2 doesn't show up. Tried on linux (default php 5.3.2
packages from ubuntu 10.04 beta1) and windows (php 5.3.2 from easyphp).

Sometimes when I use a variable variable (name of the variable in curly brackets) as a function
argument the script doesn't work as expected (execution time or memory limits are reached).
This happens only in a few places in my script (most times the same function with same arguments
works fine) and in those places if I replace the variable variables with normal variables it works
normally.

Test script:
---------------
You can download my script from:

http://www.digitaldruid.net/download/php-residence_1.2.2.zip

Install it (mysql, postgresql or sqlite needed), once you get to "main menu" click on
"configure and customize" --> "internet templates" --> "availability
template", this page will stop loading when the affected function is reached.

This function is called (twice) in file php-residence/crea_modelli.php from line 215:

mostra_menu_date("./dati/selectperiodi$anno_modello.1.php","inizioperiodo$num1",${"inizioperiodo".$num1},"","",$id_utente,$tema);
echo " ".mex("al",$pag)." ";
mostra_menu_date("./dati/selectperiodi$anno_modello.1.php","fineperiodo$num1",${"fineperiodo".$num1},"","",$id_utente,$tema);

if I replace the above code with:

$inizioperiodo = ${"inizioperiodo".$num1};
$fineperiodo = ${"fineperiodo".$num1};
mostra_menu_date("./dati/selectperiodi$anno_modello.1.php","inizioperiodo$num1",$inizioperiodo,"","",$id_utente,$tema);
echo " ".mex("al",$pag)." ";
mostra_menu_date("./dati/selectperiodi$anno_modello.1.php","fineperiodo$num1",$fineperiodo,"","",$id_utente,$tema);

then the page loads fine. The function mostra_menu_date is located in file
php-residence/includes/funzioni.php



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=51495&edit=1


Thread (4 messages)

« previous php.bugs (#169563) next »