From:             jody_leigh_salt at yahoo dot co dot uk
Operating system: XP
PHP version:      5.0.2
PHP Bug Type:     Class/Object related
Bug description:  Can't call variable objects.

Description:
------------
Can't call variable objects. Where as in PHP 4 you can!!

Reproduce code:
---------------
class bug_test {
function bug_test() {
//create a test var
$this->test_var = 'hello world';
}
function echo_test_var() {
echo $this->test_var;
}
function say_hello() {
$object = 'this';
$$object->echo_test_var();
}
}

//let show this bug!!
$test = new bug_test();
$test->say_hello();

Expected result:
----------------
Should print "hello world to screen"

Actual result:
--------------
Notice: Undefined variable: this in c:\www\php_newrust\bug.php on line 20

Fatal error: Call to a member function echo_test_var() on a non-object in
c:\www\php_newrust\bug.php on line 20

-- 
Edit bug report at http://bugs.php.net/?id=31069&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31069&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31069&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31069&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31069&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31069&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31069&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31069&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31069&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31069&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31069&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31069&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31069&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31069&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31069&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31069&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31069&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31069&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31069&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31069&r=mysqlcfg

Reply via email to