|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-20 08:00 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 09:00:01 2026 UTC |
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.