|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-06-24 02:12 UTC] stas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 13:00:01 2025 UTC |
As previously reported in bug report # 1971.. I am running the 4.0.0 release of PHP and can not access global variables outside of the function when the arrays had been reset with unset(). Here's the function : function get_images($lognum) { global $small_images, $large_images, $num_images; $ls_command = "ls pics/logs/" . $lognum . "s*.jpg"; $image_name = "pics/logs/" . $lognum . "s.jpg"; if (file_exists($image_name)) { unset($small_images); exec($ls_command,$small_images); $ls_command = "ls pics/logs/" . $lognum . "l*.jpg"; unset($large_images); exec($ls_command,$large_images); $num_images = count($small_images); } else $num_images = -1; } Then when I do: get_images($row["lognum"]); print $small_images[0]; I get no values returned. When I comment the unset lines everything works perfectly. When I run a phpinfo(), here is some of the information that's provided: FreeBSD my.systemname.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Mon Mar 20 22:50:22 GMT 2000 root@monster.cdrom.com:/usr/src/sys/compile/GENERIC i386 './configure' '--prefix=/usr/local' 'i386--freebsd4.0' '--with-system-regex' '--with-apache=/usr/ports/www/apache13-php4/work/apache_1.3.12' '--with-config-file-path=/usr/local/etc' '--disable-debug' '--enable-track-vars' '--without-gd' '--disable-pear' '--with-zlib' '--with-mcrypt=/usr/local' '--with-xml=/usr/local' '--enable-ftp'