|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-24 22:10 UTC] bugz at nagash dot org
[2004-11-24 22:13 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 22 12:00:02 2025 UTC |
Description: ------------ don't work in the class - but if I do the same action NOT IN THE CLASS METHOD - it works <form action="test.php" method="post"> <input type="text" name="name" /> <input type="submit" /> </form> <?php error_reporting (E_ALL); if (!empty($_POST['name'])) { $z = '_POST'; echo ${$z}['name']; } ?> this works fine Reproduce code: --------------- <form action="test.php" method="post"> <input type="text" name="name" /> <input type="submit" /> </form> <?php error_reporting (E_ALL); if (!empty($_POST['name'])) { class blah { function tester () { $z = '_POST'; echo ${$z}['name']; } } $a = new blah; $a->tester(); } ?> Expected result: ---------------- the value I wrote in the form Actual result: -------------- Notice: Undefined variable: _POST in /home/nagash/www/test.php on line 11