|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-10-06 17:03 UTC] nikic@php.net
[2014-10-06 18:01 UTC] pegasus at vaultwiki dot org
[2014-10-06 18:39 UTC] nikic@php.net
[2014-10-06 18:39 UTC] nikic@php.net
-Status: Open
+Status: Closed
[2014-10-07 07:10 UTC] ab@php.net
[2016-07-20 11:40 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ It seems that isset (likely others like unset, empty, etc) cannot properly resolve variably-named variables and simply returns true. Test script: --------------- function testWrapper() { foreach (array( 'testvar1', 'testvar2' ) AS $varname) { if (!isset($$varname)) { echo "\nSetting $varname\n"; $$varname = array(); } var_dump($$varname); } } testWrapper(); Expected result: ---------------- Setting testvar1 array(0) {} Setting testvar2 array(0) {} Actual result: -------------- NULL NULL