Bug #13703 Updated: PHP allows function redefinition
| From: | yasuo_ohgaki at yahoo dot com | Date: | Mon, 12 Nov 2001 03:07:09 +0000 |
| Subject: | Bug #13703 Updated: PHP allows function redefinition | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-70193@lists.php.net to get a copy of this message | ||
ID: 13703
User updated by: yasuo_ohgaki@yahoo.com
Reported By: yasuo_ohgaki@yahoo.com
Status: Critical
Bug Type: Scripting Engine problem
Operating System: linux 2.4.4/glibc 2.2.2
PHP Version: 4.0CVS-2001-10-16
New Comment:
Tested with CGI bin, I got
4.0.6: "Another A->test()"
4.0.4pl1: "Another A->test()"
When I got both functions executed, memory is broken by some code. (I have no idea what's the
cause of broken memory)
[yohgaki@dev php-4.0.6]$ ./php ~/public_html/bugs/13703/test.php
X-Powered-By: PHP/4.0.6
Content-type: text/html
Another A->test()
[yohgaki@dev php-4.0.6]$ cat config.nice
#! /bin/sh
#
# Created by configure
"./configure" \
"--without-mysql" \
"--without-pear" \
"--enable-debug" \
"$@"
[yohgaki@dev php-4.0.6]$
[yohgaki@dev php-4.0.4pl1]$ ./php ~/public_html/bugs/13703/test.php
Content-type: text/html; charset=EUC-JP
Another A->test()
[yohgaki@dev php-4.0.4pl1]$
Previous Comments:
------------------------------------------------------------------------
[2001-11-11 21:45:05] cnewbill@php.net
Ditto with 4.0.6.
-Chris
------------------------------------------------------------------------
[2001-11-11 21:30:16] sniper@php.net
Marking as Critical for now.
------------------------------------------------------------------------
[2001-11-11 21:29:55] sniper@php.net
I get "Another A->test()" with latest CVS.
Anyone got older (4.0.6) to test this with?
--Jani
------------------------------------------------------------------------
[2001-10-17 03:37:04] yasuo_ohgaki@yahoo.com
I get only "A->test()" which is the first function definition. I'm not suprised.
When I notice this bug in much complex scripts that have relatively complex class strucutre, PHP
executed both functions that have the same name. (without error/warning)
Does this bug's behaviour depend on configuration?
If anyone need configure line, let me know.
------------------------------------------------------------------------
[2001-10-17 02:01:34] mfischer@php.net
When reading your report I get the impression that the script outputs "A->test()\n"
because you said "PHP executes first function test()".
I get no redefinition error but on my system the second function is called so my output is
"Another A->test()".
So, two we have two different behaviours here or were your report not accurat?
Anyway, it doesn't look good.
- Markus
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=13703
Edit this bug report at http://bugs.php.net/?id=13703&edit=1