PHP 4.0 Bug #7890: Recursion problem with isset and unset
| From: | nickj at ihug dot com dot au | Date: | Mon, 20 Nov 2000 11:58:44 +0000 |
| Subject: | PHP 4.0 Bug #7890: Recursion problem with isset and unset | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38580@lists.php.net to get a copy of this message | ||
From: nickj@ihug.com.au
Operating system: Linux Mandrake 7.2
PHP version: 4.0.3pl1
PHP Bug Type: Scripting Engine problem
Bug description: Recursion problem with isset and unset
I have a problem with a recursive function call that does not work as I would expect. A short script
that reproduces the problem is:
<?php
function fn() {
global $test;
if (isset($test)) {
print "test is set<br>\n";
unset($test);
fn();
}
else {
print "test is NOT set<br>\n";
}
}
$test = array("exam_id" => "MATH_101", "exam_code" =>
"Mathematics Intro");
fn();
?>
What Happens: - out produced is:
test is set
test is set
test is set
test is set
test is set
test is set
... [and so on] ...
What I would expect to happen - looking for this output:
test is set
test is NOT set
[end of output]
Setup Information:
Configure command from phpinfo() gives: "'./configure'
'--with-apxs=/usr/sbin/apxs' '--without-mysql' '--disable-static'
'--disable-debug' '--enable-pic' '--enable-inline-optimization'
'--prefix=/usr' '--with-zlib' '--with-config-file-path=/etc'
'--enable-magic-quotes' '--enable-debugger' '--enable-track-vars'
'--enable-safe-mode' '--with-exec-dir=/usr/bin' '--with-regex=system'
'--with-versioning' '--enable-dba=shared' '--with-gdbm'
'--with-db2' '--enable-sysvsem' '--enable-sysvshm'
'--with-mod_charset' '--enable-force-cgi-redirect' '--with-mm'
'--enable-trans-sid' '--with-dbase' '--with-filepro'
'--enable-yp' '--enable-ftp' '--with-xml'
'--with-gettext'"
Also using Zend engine (don't know if this is relevant) : "This program makes use of the
Zend scripting language engine: Zend Engine v1.0.3, Copyright (c) 1998-2000 Zend Technologies with
Zend Optimizer v0.99, Copyright (c) 1998-2000, by Zend Technologies"
Any other information I can supply that would assist, just email me and let me know. Of course, it
could just be something obviously and embarrassingly wrong in the code above, but if it is, I
honestly can't see it.
Cheers,
Nick.
--
Edit Bug report at: http://bugs.php.net/?id=7890&edit=1