Re: Bug #10381: array_sum() on an undefined variable kills php

From: Date: Wed, 18 Apr 2001 15:33:53 +0000
Subject: Re: Bug #10381: array_sum() on an undefined variable kills php
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-51884@lists.php.net to get a copy of this message
Seems to be fixed in the latest CVS. adamw ----- Original Message ----- From: <pgl@instinct.org> To: <php-dev@lists.php.net> Sent: Wednesday, April 18, 2001 3:58 PM Subject: [PHP-DEV] Bug #10381: array_sum() on an undefined variable kills php > From: pgl@instinct.org > Operating system: Red Hat Linux 6.2 > PHP version: 4.0.4pl1 > PHP Bug Type: Reproduceable crash > Bug description: array_sum() on an undefined variable kills php > > Using array_sum() on an undefined causes php to core dump. > > uname: > Linux redbox 2.2.17-14enterprise #1 SMP Mon Feb 5 18:31:31 EST 2001 i686 unknown > > configure: > './configure' '--with-apache=../apache_1.3.19' > '--enable-gd-imgstrttf' '--with-gd' '--with-ttf' '--with-ldap' '--with-mysql=/usr' '--with-readline' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--with-zlib' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-oracle=/opt/oracle/8.1.7' '--with-oci8=/opt/oracle/8.1.7' '--with-gdbm' '--enable-dbase' '--with-snmp' '--enable-ucd-snmp-hack' '--with-gettext' '--enable-track-vars' '--enable-versioning' '--enable-ftp' '--enable-bcmath' '--with-pgsql' '--enable-calendar' > > [root@redbox address_book]# ls -l test.php > -rwxr-xr-x 1 root root 50 Apr 18 16:54 test.php > [root@redbox address_book]# cat test.php > #!/usr/local/bin/php -q > <? echo array_sum($a); ?> > [root@redbox address_book]# ./test.php > Segmentation fault (core dumped) > > If $a is defined this doesn't happen: > > [root@redbox address_book]# cat test.php > #!/usr/local/bin/php -q > <? $a[]=''; echo array_sum($a); ?> > [root@redbox address_book]# ./test.php > 0 > > > -- > Edit Bug report at: http://bugs.php.net/?id=10381&edit=1 > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.dev (#51884) next »