ID:               18590
 Comment by:       christian dot lefebvre at atosorigin dot com
 Reported By:      armageddon at raydan dot de
 Status:           No Feedback
 Bug Type:         Zend Engine 2 problem
 Operating System: WinXP Pro
 PHP Version:      5.0.0-dev
 New Comment:

I got it !

Seems that when a function is declared in an included file,

after a top level "return", it's detected as already defined





example with «t1.php» :

<?php

error_log("inc t2");

include("t2.php");



toto();



error_log("re-inc t2");

include("t2.php");



toto();



error_log("end");

?>



and «t2.php» :

<?php

error_log("in t2");



if (defined("_T2_INCLUDED")) {

  error_log("already went there");

  return;

}

define("_T2_INCLUDED", "1");



error_log("still in t2");



function toto() {

  echo "Here am I !!\n";

}



error_log("end of t2");

?>



with cli sapi of php5 RC1 or with today snapshot, here is

the output :

inc t2

in t2

still in t2

end of t2

Here am I !!

re-inc t2



Fatal error: Cannot redeclare toto() (previously declared in
.../t2.php:13) in .../t2.php on line 14



  note that even the "in t2" log is not displayed at

second include.


Previous Comments:
------------------------------------------------------------------------

[2004-03-31 09:38:46] christian dot lefebvre at atosorigin dot com

I got the same problem with RC1 version under

Linux/apache2filter

  I just tried with snapshot 200403311230 (same config)

and the message disappear but the tested code still crashes.

  As the same code works with php4.3.4, I think this ticket

should be reopened.



  I'll try to make a smaller test case

------------------------------------------------------------------------

[2003-12-04 02:24:54] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



------------------------------------------------------------------------

[2003-11-29 01:34:32] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2002-07-26 07:35:22] armageddon at raydan dot de

When I run the icq_main.php script, after some seconds I get following
two errors:



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_main.php on line 48



Fatal error: Maximum execution time of 5 seconds exceeded in
j:\www\public\phpicq\icq\icq_debug.php on line 121



Ok, thats the excepted behaviour, but when I reload the page I get this
strange error:



Fatal error: Cannot redeclare hexdump() (previously declared in :67) in
j:\www\public\phpicq\icq\icq_debug.php on line 71



When I reload it again I get the first two error-messages again and so
on...



The following code is from icq_debug, Line 67-71:



  function HexDump($in) {

      static $hex;

      if (!$hex) $hex = new Hex();

      return $hex->Dump($in);

  }



I have loaded the following modules:

php_bz2.dll, php_cpdf.dll, php_crack.dll, php_db.dll, php_dba.dll,
php_dbase.dll, php_exif.dll, php_filepro.dll, php_gd.dll,
php_gettext.dll, php_hyperwave.dll, php_ldap.dll, php_mhash.dll,
php_pdf.dll, php_pgsql.dll, php_shmop.dll, php_snmp.dll,
php_sockets.dll, php_w32api.dll, php_zlib.dll



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=18590&edit=1

Reply via email to