ID: 28752 Updated by: [EMAIL PROTECTED] Reported By: cpuidle at gmx dot de -Status: Open +Status: Wont fix Bug Type: Scripting Engine problem Operating System: WinXP PHP Version: 5CVS-2004-06-12 (dev) New Comment:
On the first item: empty($$var) evaluates correctly, recheck your test script to be sure you didn't typo somewhere. On the second item: This is expected behavior. empty() is not a function, but rather a language construct which specicically expects a real variable and not a function return value. I'll certainly grant the error message is confusing, but no more confusing than PHP4's version of this error: Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /cvs/php4/28752.php on line 15 Previous Comments: ------------------------------------------------------------------------ [2004-06-12 10:45:58] cpuidle at gmx dot de Description: ------------ Two issues exist with php5rc3 when using indirect variables: Reproduce code: --------------- <?php $test = ''; $var = 'test'; if (empty($test)) { echo 'test empty'; } // excepted & actual: test empty if (empty($$var)) { echo 'test empty'; } // expected result: test empty // actual result: <-------!! $test = 'doo'; echo trim($$var); // excepted & actual: doo if (empty(trim($$var)); // Fatal error: Can't use function return value in write // context in C:\htdocs\test4.php on line 8 // where is the write context here? <-------!! ?> Expected result: ---------------- see above Actual result: -------------- see above ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28752&edit=1