#21538 [Opn->Csd]: GTK: ctree insert_node segfaults with too many element in text array

2003-01-10 Thread alan_k
 ID:   21538
 Updated by:   [EMAIL PROTECTED]
-Summary:  GTK: possible memory leak in ctree insert_node code.
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: linux debian
 PHP Version:  4.3.0
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

change title & fix it.


Previous Comments:


[2003-01-09 01:44:25] [EMAIL PROTECTED]

PHP-GTK 0.5.1 (I dont think anything major changed in this area on
0.5.2)

to reproduce try
pear install http://devel.akbkhome.com/GTK_VarDump-0.1.tgz

the package includes a test file test1.php, just run it with
php test1.php

it attempts to var_dump globals (dont worry recursion is handled..)...

try expanding the globals recursive element a few times, then press the
OK button - I get the following segfault...

if somebody can reproduce it, it would atleast prove im not mad here
:)

I tested this on another machine, which had the zend memory lead
debugging on (and an earlier dev version of PHP4.3), indicating there
was a 4 byte leak in 
in gtk+.overides
in the  gtk_ctree_insert_node section
at this line..
text = emalloc(sizeof(gchar *) * columns);

however couldnt get it to crash :(


(gdb)  run  /usr/share/pear/tests/GTK_VarDump/tests/test1.php
Starting program: /usr/bin/php
/usr/share/pear/tests/GTK_VarDump/tests/test1.php

Program received signal SIGSEGV, Segmentation fault.
0x402a8e5a in free () from /lib/libc.so.6
(gdb) bt
#0  0x402a8e5a in free () from /lib/libc.so.6
#1  0x08129ad9 in _efree (ptr=0x8520cf4) at
/usr/src/php/php-4.3.0/Zend/zend_alloc.c:235
#2  0x0813d360 in zend_hash_apply_deleter (ht=0x81b5460, p=0x8520cf4)
at /usr/src/php/php-4.3.0/Zend/zend_hash.c:633
#3  0x0813d51b in zend_hash_apply_with_argument (ht=0x81b5460,
apply_func=0x813e644 , argument=0x8476270)
at /usr/src/php/php-4.3.0/Zend/zend_hash.c:708
#4  0x0813e6a8 in zend_clean_module_rsrc_dtors_cb (ld=0x8476258,
module_number=0xb320)
at /usr/src/php/php-4.3.0/Zend/zend_list.c:249
#5  0x0813d50a in zend_hash_apply_with_argument (ht=0x81b1080,
apply_func=0x813e660 , 
argument=0xb320) at
/usr/src/php/php-4.3.0/Zend/zend_hash.c:707
#6  0x0813e6f5 in zend_clean_module_rsrc_dtors (module_number=28) at
/usr/src/php/php-4.3.0/Zend/zend_list.c:260
#7  0x0813b6b0 in module_destructor (module=0x823e5f0) at
/usr/src/php/php-4.3.0/Zend/zend_API.c:1117
#8  0x0813d2ac in zend_hash_apply_deleter (ht=0x81b5600, p=0x823e5c0)
at /usr/src/php/php-4.3.0/Zend/zend_hash.c:598
#9  0x0813d493 in zend_hash_apply (ht=0x81b5600, apply_func=0x813b78c
)
at /usr/src/php/php-4.3.0/Zend/zend_hash.c:689
#10 0x08138a40 in zend_deactivate_modules () at
/usr/src/php/php-4.3.0/Zend/zend.c:634
#11 0x0810fdcd in php_request_shutdown (dummy=0x0) at
/usr/src/php/php-4.3.0/main/main.c:928
#12 0x0815267d in main (argc=2, argv=0xba94) at
/usr/src/php/php-4.3.0/sapi/cli/php_cli.c:803
(gdb) 





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




#20352 [Opn->Bgs]: PHP-GTK apps crash with corrupt argc/argv error

2003-02-11 Thread alan_k
 ID:   20352
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: Reproducible crash
 Operating System: RedHat Linux 7.3
 PHP Version:  4.3.0-pre2
 New Comment:

yes this is a known problem if you mix versions on the same machine
(even if you are not aware of it).. 

Fix - make sure your PHP version that you run php-gtk with is the same
as the one you build it with.



Previous Comments:


[2003-02-11 01:34:55] [EMAIL PROTECTED]

had the same problem and solved it:

problem was, that i had 2 php versions (4.1.0 and 4.3.0) installed and
the "buildconf" call for php-gtk just configured to get used with
(4.1.0 the default php-installation) 

so php-gtk first found the php (4.1.0) installed in /usr/bin the
distribution-installation from Mandrake and php-gtk worked fine with it
... 

but i tried to use my own php-version (4.3.0) with gtk, so i completly
removed the 4.1.0 and run the php-gtk build process again ...
everything runs fine now.



[2002-11-10 22:05:26] [EMAIL PROTECTED]

Trying to run any program that uses the PHP-GTK extension dies
immediately with an error message similar to this:
PHP Fatal error:  php-gtk: argc/argv are corrupted in
/root/php-gtk-cvs/test/hello.php on line 7





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




#22320 [Opn->Bgs]: preg_match have BUG ???

2003-02-20 Thread alan_k
 ID:   22320
 Updated by:   [EMAIL PROTECTED]
 Reported By:  php at frusti dot com
-Status:   Open
+Status:   Bogus
 Bug Type: PCRE related
 Operating System: Windows 2000
 PHP Version:  4.3.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

[WHERE.*|$] matches W or H or E or R or E or . or * or | or $,


Previous Comments:


[2003-02-20 03:35:04] php at frusti dot com

!!! I have a urgence problem !!!

Please show this statements:

$sql = "UPDATE TFrusti SET entity='FAN', SYSFLD001='Test with Clob-Data
Entity just for test!' WHERE SYSPID = 411";
preg_match("/^UPDATE\s(\w+)\sSET\s(.*?)([WHERE.*|$])/s",$sql,$matches);

my problem now is, if in the subject (here the value of the $sql) is
the word "Entity" this expression deliver just a truncated match, but
if the word "entity" ist in lower-case inside the $sql-Variable the
expression deliver the correct matches

Results:
$matches[2] with lower-case "entity" shows following value:
"entity='FAN', SYSFLD001='Test with Clob-Data Entity just for test!'"

$matches[2] with upper-case "Entity" shows this values:
entity='FAN', SYSFLD001='Test with Clob-Data"

Have anyone a answer or know this problems?

Thanks and best regards,
Frast Andreas





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




#20512 [Opn->Bgs]: Page Refresh Problem

2002-11-19 Thread alan_k
 ID:   20512
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: Windows NT
 PHP Version:  4.2.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


Previous Comments:


[2002-11-20 01:29:48] [EMAIL PROTECTED]

After Authenticatiion I display a page.
If I click the back button I get the following Message

Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available.
As a security precaution, Internet Explorer does not automatically
resubmit your information for you. 

To resubmit your information and view this Web page, click the Refresh
button. 

I am using internet explorer 5.0







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




#13726 [Csd]: mktime bug

2002-11-20 Thread alan_k
 ID:   13726
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Closed
 Bug Type: Date/time related
 Operating System: windows NT4.0
 PHP Version:  4.0.6
 New Comment:

try looking at the Date Package in PEAR
pear.php.net



Previous Comments:


[2002-11-20 19:39:38] [EMAIL PROTECTED]

My ISP is using a new release of glibc and now mktime strtotime are not
working for dates prior to 1970. I need to be able to add subtract a
day from dates between now and before 1870 anybody ?

ie http://www.boxrec.com/date_search.php I need to generate the dates
either side of the search date for the forward / backward links.



[2002-11-14 06:46:59] [EMAIL PROTECTED]

In our fine manual:

http://www.php.net/manual/en/function.date.php



[2002-11-14 06:42:53] [EMAIL PROTECTED]

What's the offical suggestion for getting UNIX timestamps for dates <
1970? Or is it not allowed to use them this way?

BTW: The offical PHP docs say, that dates between 1902 and 2037 are
_allowed_. But you say "so stay away from undefined value ranges"!?
Very strange. 

Can you explain that to the users/developers community?



[2001-10-18 05:55:54] [EMAIL PROTECTED]

behaviour of unix timestamp functions for dates
before 1.1.1970 is simply undefined and depends 
on the system *and* c library implementation you
use

so stay away from undefined value ranges :)



[2001-10-18 02:31:32] [EMAIL PROTECTED]

mktime(0,0,0,1,1,1969); 
is return -1.

but in linux renturn valid value;

maybe before 1970 bug in win32 version.




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




#20527 [Bgs]: unixdate

2002-11-21 Thread alan_k
 ID:   20527
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Bogus
 Bug Type: Apache2 related
 Operating System: Linux 2.4.19
 PHP Version:  4CVS-2002-11-20 (dev)
 New Comment:

its a bug in the adobdb.inc.php file - it declares unixdate twice in
version 2.43, looks like it is fixed in 2.5

php4.3 will now produce errors if you declare a method more than once
in the same class.. (previous versions of php did not)



Previous Comments:


[2002-11-21 02:44:39] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

you\'re most likely have a double inclusion mixup. make sure, that in
the code you run UnixDate is declared only once.



[2002-11-20 18:51:07] [EMAIL PROTECTED]

PHP Fatal error:  Cannot redeclare unixdate() in
/web/htdocs/home/pnadodb/adodb.inc.php on line 147

Here it's the code that generate the error:

/**
 * Also in ADORecordSet.
 * @param $v is a date string in -MM-DD format
 *
 * @return date in unix timestamp format, or 0 if before
TIMESTAMP_FIRST_YEAR, or false if invalid date format
 */
function UnixDate($v)
{
if (!preg_match(
"|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})|",
($v), $rr)) return false;

if ($rr[1] <= TIMESTAMP_FIRST_YEAR) return 0;
// h-m-s-MM-DD-YY
return mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
}

The funcion is called in this way:
---
else $d = ADOConnection::UnixDate($d);


The same program works find with Apache1.3.27+php-4.2.3 

You can try this program at http://php.weblogs.com/ADODB
it's named "ADOdb Library for PHP"

Regards.




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




#20688 [Opn->Bgs]: Math zero

2002-11-27 Thread alan_k
 ID:   20688
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: windows
 PHP Version:  4.2.3
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

there are quite a few bug reports on this.

adding floats can produce unpredicable results
you could try using bcmath or sprintf

$temp=-1.0;
for($i=0;$i<=10;$i++){
$temp=(float) sprintf("%.2f",$temp+0.2);
echo "".$temp;
}


Previous Comments:


[2002-11-27 19:42:49] [EMAIL PROTECTED]

".$temp;
}
?>

the output is :

-0.8
-0.6
-0.4
-0.2
-5.55111512313E-017
0.2
0.4
0.6
0.8
1
1.2




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




#20735 [Opn->Fbk]: Crashing, when trying to create DB_DataObject Class definitions

2002-11-30 Thread alan_k
 ID:   20735
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Windows 2000
 PHP Version:  4.3.0RC2
 New Comment:

can you send me ([EMAIL PROTECTED]) the database create script and your
ini file - I'll see if I can reproduce this on linux.



Previous Comments:


[2002-11-30 06:52:06] [EMAIL PROTECTED]

When I try to create to DB_DataObject class definition (DB_DataObject
0.6) I get a crash.

I give the instruction:

d:\php430\php.exe createTables.php D:\work\livo2\etc\dbo_livo.ini

The message box (unfortunatly in german) says:

Die Anweisung in "0x778cb9b1" verweist auf Speicher in "0x".
Der Vorgang "written" konnte nicht auf dem Speicher durchgeführt
werden.

Klicken Sie auf "OK", um das Programm zu beenden.
Klicken Sie auf "Abbrechen", um das Programm zu debuggen.

(The instruction in "0x778cb9b1" refers to memory at "0x". The
task "written" could not be processed. (...)).

Contact me for screenshots and more, if you want.

Regards,

Peter Hopfgartner




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




#20735 [Fbk]: Crashing, when trying to create DB_DataObject Class definitions

2002-11-30 Thread alan_k
 ID:   20735
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Windows 2000
 PHP Version:  4.3.0RC2
 New Comment:

can you try setting the
debug = 5
in the ini file 

This should give you an idea of how far it is getting before crashing.

Then just add exit;'s until you locate the line of code that is causing
it to die. - my guess is that is a bug with the ms-sql bindings.
Unfortunatly I dont have access to ms-sql (or windows 2000) to test
this on.

Regards
Alan


Previous Comments:


[2002-11-30 07:34:41] [EMAIL PROTECTED]

can you send me ([EMAIL PROTECTED]) the database create script and your
ini file - I'll see if I can reproduce this on linux.




[2002-11-30 06:52:06] [EMAIL PROTECTED]

When I try to create to DB_DataObject class definition (DB_DataObject
0.6) I get a crash.

I give the instruction:

d:\php430\php.exe createTables.php D:\work\livo2\etc\dbo_livo.ini

The message box (unfortunatly in german) says:

Die Anweisung in "0x778cb9b1" verweist auf Speicher in "0x".
Der Vorgang "written" konnte nicht auf dem Speicher durchgeführt
werden.

Klicken Sie auf "OK", um das Programm zu beenden.
Klicken Sie auf "Abbrechen", um das Programm zu debuggen.

(The instruction in "0x778cb9b1" refers to memory at "0x". The
task "written" could not be processed. (...)).

Contact me for screenshots and more, if you want.

Regards,

Peter Hopfgartner




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




#20735 [Fbk]: Crashing, when trying to create DB_DataObject Class definitions

2002-12-04 Thread alan_k
 ID:   20735
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Windows 2000
 PHP Version:  4.3.0RC2
 New Comment:

can you try a snapshot release - latest cvs from (snaps.php.net) - I
believe there where some fixes to the ms-sql driver in the last few
days.



Previous Comments:


[2002-11-30 09:10:11] [EMAIL PROTECTED]

can you try setting the
debug = 5
in the ini file 

This should give you an idea of how far it is getting before crashing.

Then just add exit;'s until you locate the line of code that is causing
it to die. - my guess is that is a bug with the ms-sql bindings.
Unfortunatly I dont have access to ms-sql (or windows 2000) to test
this on.

Regards
Alan



[2002-11-30 07:34:41] [EMAIL PROTECTED]

can you send me ([EMAIL PROTECTED]) the database create script and your
ini file - I'll see if I can reproduce this on linux.




[2002-11-30 06:52:06] [EMAIL PROTECTED]

When I try to create to DB_DataObject class definition (DB_DataObject
0.6) I get a crash.

I give the instruction:

d:\php430\php.exe createTables.php D:\work\livo2\etc\dbo_livo.ini

The message box (unfortunatly in german) says:

Die Anweisung in "0x778cb9b1" verweist auf Speicher in "0x".
Der Vorgang "written" konnte nicht auf dem Speicher durchgeführt
werden.

Klicken Sie auf "OK", um das Programm zu beenden.
Klicken Sie auf "Abbrechen", um das Programm zu debuggen.

(The instruction in "0x778cb9b1" refers to memory at "0x". The
task "written" could not be processed. (...)).

Contact me for screenshots and more, if you want.

Regards,

Peter Hopfgartner




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




#20929 [Opn->Fbk]: Problem in handling big5 characters from HTML form

2002-12-11 Thread alan_k
 ID:   20929
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: Redhat Linux 7.2
 PHP Version:  4.2.3
 New Comment:

2)htmlentities has an extra optional argument for characterset

Can you double check what that the brower is sending to the server
(karpski), and see if theres any difference between you r Apache1.3 &
Apache2.0 setup



Previous Comments:


[2002-12-11 19:36:37] [EMAIL PROTECTED]

I have tried the latest PHP CVS 4.4.0-dev(200212120030).
The problem still exist. All "big 5" characters from HTML form POST/GET
are always converted to HTML codes. No function can be used to convert
HTML codes back to "big 5" characters.

Thanks.



[2002-12-10 22:40:04] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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



[2002-12-10 21:43:15] [EMAIL PROTECTED]

1. When I use $_REQUEST, $_POST, $_GET to retrieve the data of a HTML
form, all "big5" characters will be changed to some HTML codes (e.g.
"$#20806"). Although these HTML codes can be displayed correctly in
browsers, I cannot convert them back to "big5" code. 

With PHP4.2.3 on Apache 1.3.27, there is no problem. PHP can retrieve
"big5" characters from HTML form.


2. The "htmlentities" function does not correctly convert "big5"
characters to html codes. Wrong html codes are generated and cannot be
correctly displayed in browser.




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




#21486 [Opn->Dup]: $this pointer not always pointing to the right object

2003-01-07 Thread alan_k
 ID:   21486
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Duplicate
 Bug Type: Class/Object related
 Operating System: windows
 PHP Version:  4.3.0
 New Comment:

$this is that of the calling class when you use static method calls,
The official line is dont rely on this behaviour as
it may change...
ref: php-dev mailing list.


Previous Comments:


[2003-01-07 06:19:33] [EMAIL PROTECTED]

hi,
i found that the $this pointer does not always point to the current
class, as it is supposted to.

run the following example code:
-
class ca
{
function debug()
{
echo("ca::debug -> ");
print_r($this);
echo("");
}
}

class cb
{
function debug()
{
echo("cb::debug -> ");
print_r($this);
echo("");
}

function test()
{
cb::debug();
ca::debug();
}
}

$b = new cb;
$b->test();
-

output is:
cb::debug -> cb Object ( ) 
ca::debug -> cb Object ( ) 

but should'nt it be:
cb::debug -> cb Object ( ) 
ca::debug -> ca Object ( ) 

it seems that when a class is called like class::methode from within
another class, the this pointer points to the calling class, not the
current running class!!




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




Bug #16522 Updated: ImageMagick functions

2002-04-09 Thread alan_k

 ID:  16522
 Updated by:  [EMAIL PROTECTED]
 Reported By: [EMAIL PROTECTED]
-Status:  Open
+Status:  Closed
 Bug Type:Feature/Change Request
 PHP Version: 4.1.2
 New Comment:

It is already in PECL (pear extention C library)

have a look at 

http://pear.php.net/manual/en/pecl.imagick.php


Previous Comments:


[2002-04-09 23:48:10] [EMAIL PROTECTED]

It would be nice to see a PHP implementation of the ImageMagick
library. There are already perl and c++ interfaces, so it probably
wouldn't be that bad to implement.




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




Bug #13876 Updated: Not possible to build DBA as shared extension

2002-04-17 Thread alan_k

 ID:   13876
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Analyzed
 Bug Type: DBM/DBA related
-Operating System: NetBSD
+Operating System: NetBSD + Linux
-PHP Version:  4.0.6
+PHP Version:  4.2.0RC4
 New Comment:

Full patch to fix this - attached - let me know if you want the patch
as a file - I can send it.

--- /usr/src/php/php-4.1.2/ext/dba/config.m4Thu Jun 28 23:16:28
2001
+++ config.m4   Thu Apr 18 13:19:19 2002
@@ -230,6 +230,5 @@
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)
-  AC_DEFINE(HAVE_DBA, 0, [ ])
 fi
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_cdb.c Thu Feb 28 16:25:58
2002
+++ dba_cdb.c   Thu Apr 18 13:27:47 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_CDB
 #include "php_cdb.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_db2.c Thu Feb 28 16:25:58
2002
+++ dba_db2.c   Thu Apr 18 13:27:23 2002
@@ -16,10 +16,14 @@
   
+--+
  */
 
-/* $Id: dba_db2.c,v 1.20 2002/02/28 08:25:58 sebastian Exp $ */
+/* $Id: dba_db2.c,v 1.20.2.1 2002/04/08 06:36:39 derick Exp $ */
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DB2
 #include "php_db2.h"
 #include 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_db3.c Thu Feb 28 16:25:58
2002
+++ dba_db3.c   Thu Apr 18 13:27:57 2002
@@ -20,10 +20,14 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DB3
 #include "php_db3.h"
-#include 
 
+#include 
 #include 
 #ifdef DB3_INCLUDE_FILE
 #include DB3_INCLUDE_FILE
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_dbm.c Thu Feb 28 16:25:59
2002
+++ dba_dbm.c   Thu Apr 18 13:28:15 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DBM
 #include "php_dbm.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_gdbm.cThu Feb 28 16:25:59
2002
+++ dba_gdbm.c  Thu Apr 18 13:28:30 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_GDBM
 #include "php_gdbm.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_ndbm.cThu Feb 28 16:25:59
2002
+++ dba_ndbm.c  Thu Apr 18 13:28:42 2002
@@ -20,10 +20,15 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_NDBM
 #include "php_ndbm.h"
 
 #include 
+
 #ifdef NDBM_INCLUDE_FILE
 #include NDBM_INCLUDE_FILE
 #endif



Previous Comments:


[2001-10-30 12:42:07] [EMAIL PROTECTED]

If php is configured and installed on a system without any
db libraries, then a db library, e.g. gdbm, is installed 
afterwards, it's not possible to separately build the DBA 
module as a shared extension.  The problem occurs because 
when a db library is not found when php is configured, the 
php_config.h file written out contains the line:

#define HAVE_DBA 0

Later, when the DBA module is phpize'd and configured, the
HAVE_DBA definition from php_config.h overrides the value 
set in the local config.h file, which causes all of the 
code to be ifdef'd out.  Even when this problem is fixed, 
the various dba_.c files that implement the PHP 
functions for a particular db library will have all of 
their code ifdef'd out since the DBA_ definitions in 
the local config.h file aren't used.

The complete fix is simple:

1) Remove the line "AC_DEFINE(HAVE_DBA, 0, [ ])" from
   ext/dba/config.m4.
2) For each dba_.c file, add at the top before
   php.h is included the following lines:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

I have a patch relative to the php-4.0.6 source tree that 
makes the above changes, located at:

http://jgrind.org/~jlam/patch.dba-4.0.6






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




Bug #13876 Updated: Not possible to build DBA as shared extension

2002-04-18 Thread alan_k

 ID:   13876
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Analyzed
+Status:   Closed
 Bug Type: DBM/DBA related
 Operating System: NetBSD + Linux
 PHP Version:  4.2.0RC4
 New Comment:

This bug has been fixed in CVS.

thanks - this should now work with 4.2.0 and greater 


Previous Comments:


[2002-04-18 01:36:31] [EMAIL PROTECTED]

Full patch to fix this - attached - let me know if you want the patch
as a file - I can send it.

--- /usr/src/php/php-4.1.2/ext/dba/config.m4Thu Jun 28 23:16:28
2001
+++ config.m4   Thu Apr 18 13:19:19 2002
@@ -230,6 +230,5 @@
   PHP_SUBST(DBA_SHARED_LIBADD)
 else
   AC_MSG_RESULT(no)
-  AC_DEFINE(HAVE_DBA, 0, [ ])
 fi
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_cdb.c Thu Feb 28 16:25:58
2002
+++ dba_cdb.c   Thu Apr 18 13:27:47 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_CDB
 #include "php_cdb.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_db2.c Thu Feb 28 16:25:58
2002
+++ dba_db2.c   Thu Apr 18 13:27:23 2002
@@ -16,10 +16,14 @@
   
+--+
  */
 
-/* $Id: dba_db2.c,v 1.20 2002/02/28 08:25:58 sebastian Exp $ */
+/* $Id: dba_db2.c,v 1.20.2.1 2002/04/08 06:36:39 derick Exp $ */
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DB2
 #include "php_db2.h"
 #include 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_db3.c Thu Feb 28 16:25:58
2002
+++ dba_db3.c   Thu Apr 18 13:27:57 2002
@@ -20,10 +20,14 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DB3
 #include "php_db3.h"
-#include 
 
+#include 
 #include 
 #ifdef DB3_INCLUDE_FILE
 #include DB3_INCLUDE_FILE
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_dbm.c Thu Feb 28 16:25:59
2002
+++ dba_dbm.c   Thu Apr 18 13:28:15 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_DBM
 #include "php_dbm.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_gdbm.cThu Feb 28 16:25:59
2002
+++ dba_gdbm.c  Thu Apr 18 13:28:30 2002
@@ -20,6 +20,10 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_GDBM
 #include "php_gdbm.h"
 
--- /usr/src/php/php-4.2.0RC2/ext/dba/dba_ndbm.cThu Feb 28 16:25:59
2002
+++ dba_ndbm.c  Thu Apr 18 13:28:42 2002
@@ -20,10 +20,15 @@
 
 #include "php.h"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if DBA_NDBM
 #include "php_ndbm.h"
 
 #include 
+
 #ifdef NDBM_INCLUDE_FILE
 #include NDBM_INCLUDE_FILE
 #endif




[2001-10-30 12:42:07] [EMAIL PROTECTED]

If php is configured and installed on a system without any
db libraries, then a db library, e.g. gdbm, is installed 
afterwards, it's not possible to separately build the DBA 
module as a shared extension.  The problem occurs because 
when a db library is not found when php is configured, the 
php_config.h file written out contains the line:

#define HAVE_DBA 0

Later, when the DBA module is phpize'd and configured, the
HAVE_DBA definition from php_config.h overrides the value 
set in the local config.h file, which causes all of the 
code to be ifdef'd out.  Even when this problem is fixed, 
the various dba_.c files that implement the PHP 
functions for a particular db library will have all of 
their code ifdef'd out since the DBA_ definitions in 
the local config.h file aren't used.

The complete fix is simple:

1) Remove the line "AC_DEFINE(HAVE_DBA, 0, [ ])" from
   ext/dba/config.m4.
2) For each dba_.c file, add at the top before
   php.h is included the following lines:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

I have a patch relative to the php-4.0.6 source tree that 
makes the above changes, located at:

http://jgrind.org/~jlam/patch.dba-4.0.6






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




Bug #9222 Updated: dbmreplace() and dbmdelete() don't run

2002-04-18 Thread alan_k

 ID:   9222
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: DBM/DBA related
 Operating System: Win32
 PHP Version:  4.0.4pl1
 New Comment:

can you try again using php4.2.0RC4?

http://www.php.net/~derick/


Previous Comments:


[2001-02-12 02:39:39] [EMAIL PROTECTED]

I want to use a dbm-database. I can insert, but I can't replace or
delete anything. 
E.g.:



(No gdb-backtrace available, sorry)

Greetzz by da
Kruemelkiller




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




Bug #8819 Updated: dbm functions do not work correctly

2002-04-18 Thread alan_k

 ID:   8819
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: DBM/DBA related
 Operating System: Win32
 PHP Version:  4.0.4pl1
 New Comment:

can you try again using php4.2.0RC4?

http://www.php.net/~derick/




Previous Comments:


[2001-01-20 12:30:13] [EMAIL PROTECTED]

I forgot to specify in my original comment that the problematic format
in question is flatfile.



[2001-01-20 11:24:36] [EMAIL PROTECTED]

DBM functions seem not to work correctly on Win32 (PHP/Apache). The
problem probably has to do with with unix/dos ascii file EOL
identifiers. I've tried the same code on another server with PHP/Apache
installed on Linux and it works correctly there.






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




Bug #9283 Updated: Serialized data gets corrupted in DBM

2002-04-18 Thread alan_k

 ID:   9283
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: DBM/DBA related
 Operating System: Windows 98
 PHP Version:  4.0.4pl1
 New Comment:

can you try again to reproduce this using php4.2.0RC4?

http://www.php.net/~derick/




Previous Comments:


[2001-02-15 11:53:08] [EMAIL PROTECTED]

I created a set of programs for maintaining userid and password
information using the DBM functions. (dbmopen, dbminsert, etc).. I keep
userid, password, effective date, expiry dates, etc... Hence I need to
keep more than just name & password pairs... I use the userid as the
name and the value is a serialized variable containing an associative
array of the remaining fields... 

My PHP programs to add and display the user records works -
unfortunately it works intermittently... Some time all records are
written correctly and are displayed correctly.. but sometime several
are written but when are displayed, the details of the serialized data
are missing.. it seems to be corrupted...

I attach some code for the dbminsert and dbmfetch here...

Notes: $user is an associative array containing the password, start
dates, etc.

function addUser( $dbName, &$dbStatus,  $userid, $user ) {
  $dbh = dbmopen( "$dbName", "w" )
 or die("Couldn't open $dbName database");
  $serial_user = serialize( $user );
  print "serial_user is equal to  $serial_user ";
  $dbStatus = dbminsert( $dbh, "$userid", "$serial_user" );
  dbmclose( $dbh );
  }

function getUser( $dbName, &$dbStatus, $userid ) {
  $dbh = dbmopen( "$dbName", "r" )  // --- read db 
 or die("Couldn't open $dbName database");
  if ( dbmexists( $dbh, $userid ) )
{
$serial_user = dbmfetch( $dbh, $userid );
print "serial_user is equal to  $serial_user ";
$user = unserialize( $serial_user );
}
  else
{ $dbStatus = -1; }
  dbmclose( $dbh );
  return $user;
  }

I looked at the dbm file itself using a text editor and all the data
are present, even for those records that shows blanks for the details.

I opened 2 Internet Explorer windows side by side and ran the insert
program on one and the display on the other. I displayed the serialized
value (i.e. $serial_user) on both windows...

In the add window, the serialized data always looks like this:
a:5:{s:4:"name;s:1:"a";s:3:"pwd ETC ETC...

In the display window, the serialized data also looked as above when
the data is displayed correctly... 

However, when the data is 'missing' the serialized data looks like
this
:5:{s:4:"name;s:1:"a";s:3:"pwd ETC ETC...
(i.e. the 'a' is missing).

(you can see my debugging print statements in the code that I attached
above).

I am running PHP on Apache Web Server (1.3.14) for Windows. Both the
browser client and the Apache server are running on the same PC.

Thanks in advance for your help!







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




Bug #17053 Updated: argc,argv not defined when running php -q

2002-05-06 Thread alan_k

 ID:   17053
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: Windows
 PHP Version:  4.2.0
 New Comment:

In PHP 4.2.0, the 'register_globals' setting default changed to
be off. See http://www.php.net/release_4_2_0.php for more info.


Previous Comments:


[2002-05-06 18:40:41] [EMAIL PROTECTED]

On clean install of Windows binary 4.2.0 installer:

While running php -q on windows release 4.2.0, argc and argv are not
defined. The following script reproduces the error message:



This worked in 4.0.6.




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




#19664 [Opn->Bgs]: Comments in PHP

2002-09-29 Thread alan_k

 ID:   19664
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Linux
 PHP Version:  4.2.1


Previous Comments:


[2002-09-29 18:10:53] [EMAIL PROTECTED]

Ignore the previous message. Sorry



[2002-09-29 18:08:34] [EMAIL PROTECTED]

Hi

If the line is ended with semicolon (;), the open ended comments (//)
do not work

Eg. This does not work

// Ignore this line ;

This will print the whole line

Thanks

Anil





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




#19665 [Opn->Bgs]: Virus from PHP recommended software

2002-09-29 Thread alan_k

 ID:   19665
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: Windows
 PHP Version:  4.2.3
 New Comment:

please leave this as bogus.

- if you want to note which link this relates to (add it as a comment)
- please contact the site owner about that particular file.


Previous Comments:


[2002-09-29 20:17:04] [EMAIL PROTECTED]

C:\Program Files\Evrsoft\1st Page 2000\IScripts\Buttons\Six buttons
from
hell.izs
is infected with the JS.WindowBomb virus.
Unable to repair this file.

This is just a warning so that folks dont follow the link to this
software.  Fortunately my scanner caught it.



[2002-09-29 20:04:04] [EMAIL PROTECTED]

This has absolutely nothing to do with PHP..




[2002-09-29 19:52:49] [EMAIL PROTECTED]

Date: 9/29/2002, Time: 20:37:08, Big Dad on KKD
The file
C:\Program Files\Evrsoft\1st Page 2000\IScripts\Buttons\Six buttons
from hell.izs
is infected with the JS.WindowBomb virus.
Unable to repair this file.


Date: 9/29/2002, Time: 20:37:08, Big Dad on KKD
The file
C:\Program Files\Evrsoft\1st Page 2000\IScripts\Buttons\Six buttons
from hell.izs
is infected with the JS.WindowBomb virus.
Access to the file was denied.

I went and got their software per a link on your site.  this is what I
got when I installed it.




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




#19842 [Opn]: is_object returns FALSE on Incomplete classes

2002-10-09 Thread alan_k

 ID:   19842
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: Class/Object related
 Operating System: linux
 PHP Version:  4CVS-2002-10-10
 New Comment:

variable object variables also fail on incomplete classes:

eg. (from the example below)

$data = unserialize(file_get_contents('/tmp/test'));
$key = 't';
var_dump($data->$key); // is blank.
//however
$ar = get_object_vars($data);
echo $ar[$key]; // produces 1




Previous Comments:


[2002-10-10 01:55:22] [EMAIL PROTECTED]

Steps to reproduce
a) generate a serialized class
eg.
class atest {
  var $t = 1;
}
$t = new atest;
$fh = fopen('/tmp/test','w');
fwrite($fh,serialize($t));
fclose($fh);
--
In another file
$data = unserialize(file_get_contents('/tmp/test'));
if (!is_object($data)) {
   echo "DATA is an ".gettype($b)."!\n"; }
}

 should output 
DATA is an object!

It's on the verge of expected behaviour, but it would be nice if it
worked :)







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




Bug #16287 Updated: SUID for PHP scripts

2002-03-26 Thread alan_k

 ID:   16287
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: RH7.2
 PHP Version:  4.1.2
 New Comment:

This is part of Apache &/or the web server responsiblity, doing it in
PHP, would (apart from duplicate resources), be a bit security
headache..

I believe it is a feature of Apache 2. 

If you are looking at cgi's, you could consider the php-cgiwrap that is
available on the net somewhere.

Its not really (AFAIK) ever going to be a php feature.





Previous Comments:


[2002-03-26 09:16:52] [EMAIL PROTECTED]

ooops should've changed the status before...



[2002-03-26 09:12:48] [EMAIL PROTECTED]

Those functions are very good, except they cannot be used in a hosting
context where the users are not root...

There should be a mechanism like Apache has for .cgi's (per virtual
host or location) or dynamically establishing the owner via the home
directory lookup.



[2002-03-26 09:08:19] [EMAIL PROTECTED]

http://php.net/posix_setuid



[2002-03-26 09:01:24] [EMAIL PROTECTED]

PHP already has functions to swap uids and guids, posix_* (see
www.php.net/posix).

Derick



[2002-03-26 08:59:44] [EMAIL PROTECTED]

There is a need for suexec/suid type functionality for PHP scripts -
switch of ownership conext in a secure environment. Is this going to
happen?





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




#26466 [Opn->Fbk]: Looking for files in the home directory of unheardof user

2003-11-29 Thread alan_k
 ID:   26466
 Updated by:   [EMAIL PROTECTED]
 Reported By:  te0 at playrpg dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Compile Failure
 Operating System: Mac OS X
 PHP Version:  4.3.4
 New Comment:

i suspect this is a problem with your apache2 libs not reporting the
correct folder

check the outputs of 
apxs -q CFLAGS
apr-config --includes
apu-config --includes

is incorrect - probably a bug with the Apache2 dev package on OSX

(have a look at sapi/apache2handler/config.m4 to get an idea of what
happens)



Previous Comments:


[2003-11-29 12:44:53] te0 at playrpg dot com

It seems you don't have to use --with-expat-dir for this to happen. It
happens without specifying that.



[2003-11-29 12:31:40] te0 at playrpg dot com

Description:

When compiling (make after ./configure) using OS 10.2, Apache2 i get:


gcc: /Users/afaby/Projects/Apache2/httpd-2.0.44/srclib/apr-util-lexpat:
No such file or directory (i don't have a user called afaby)

afaby is NOT a user on my system, and it appears that there is a bug in
the make script which is getting the absolute path to the files instead
of the relative path

Reproduce code:
---
Use --with-expat-dir=/Library/Apache2 when ./configuring php4.3.4 and
make.






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


#26466 [Csd->Bgs]: Looking for files in the home directory of unheardof user

2003-11-30 Thread alan_k
 ID:   26466
 Updated by:   [EMAIL PROTECTED]
 Reported By:  te0 at playrpg dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: Compile Failure
 Operating System: Mac OS X
 PHP Version:  4.3.4
 New Comment:

changing status to keep bug db clean.


Previous Comments:


[2003-11-29 20:14:15] te0 at playrpg dot com

That was the problem.

apu-config gave me the bad directory.



[2003-11-29 19:50:55] [EMAIL PROTECTED]

i suspect this is a problem with your apache2 libs not reporting the
correct folder

check the outputs of 
apxs -q CFLAGS
apr-config --includes
apu-config --includes

is incorrect - probably a bug with the Apache2 dev package on OSX

(have a look at sapi/apache2handler/config.m4 to get an idea of what
happens)




[2003-11-29 12:44:53] te0 at playrpg dot com

It seems you don't have to use --with-expat-dir for this to happen. It
happens without specifying that.



[2003-11-29 12:31:40] te0 at playrpg dot com

Description:

When compiling (make after ./configure) using OS 10.2, Apache2 i get:


gcc: /Users/afaby/Projects/Apache2/httpd-2.0.44/srclib/apr-util-lexpat:
No such file or directory (i don't have a user called afaby)

afaby is NOT a user on my system, and it appears that there is a bug in
the make script which is getting the absolute path to the files instead
of the relative path

Reproduce code:
---
Use --with-expat-dir=/Library/Apache2 when ./configuring php4.3.4 and
make.






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


#26571 [Opn->Fbk]: func_get_arg(),func_get_args() fail to give value.

2003-12-09 Thread alan_k
 ID:   26571
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Mentaloid at hotmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Linux 2.4.22 SMP
 PHP Version:  4.3.3
 New Comment:

I cant reproduce this on php5 or php4.3.2-RC

Does this exhibit the same problem?
php -r 'function test() { print_r(func_get_args()); }
test("","");'




Previous Comments:


[2003-12-09 21:23:50] Mentaloid at hotmail dot com

Description:

When passing a string containing 8 bytes that represents hexadecimal
data such as '' to a user function that utilizes func_get_arg()
or func_get_arg(), values become unavailable (zero length string) while
func_num_args() will show that the value existed.

Configure Line "'./configure' '--with-mysql=/usr/local/mysql'
'--with-ftp' '--enable-sockets'
'--with-apxs2=/usr/local/apache2/bin/apxs'"

Apache 2.0, standard config + frontpage extensions. Frontpage
extensions not active on this virtualhost.
Standard INI, with the exception of ASP TAGS.

PHPInfo page can be viewed @
http://tko.mentadd.com/ServerControl/control/xxPhpInfo.php

Reproduce code:
---
function binlogdata() {
global $DB, $scbinlogtable;
$args = func_get_args();
$results = '';
foreach ($args as $key => $value) {
if ($key == 0) {
$results = $results.''.$value.'';
} else {
$results = 
$results.''.$value.'';
}
}
return $results;
}

$fetch['test1'] = 'thisisok';
$fetch['test2'] = '';

echo binlogdata('PlayerLimit',$fetch['test1'],$fetch['test2']);



Expected result:

// The expected result is
"PlayerLimitthisisok";


Actual result:
--
// The actual result is
"PlayerLimitthisisok";






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


#26572 [Opn->Bgs]: Session & Simple variable name overlap

2003-12-09 Thread alan_k
 ID:   26572
 Updated by:   [EMAIL PROTECTED]
 Reported By:  hsutanto78 at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: FreeBSD 4.7
 PHP Version:  4.3.3
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

I think you will find the versions/php.ini are different 

you should not really write code that expects $dim to be set 


Previous Comments:


[2003-12-09 21:27:28] hsutanto78 at hotmail dot com

Description:

Session & simple variable name overlap

Reproduce code:
---
session_start();
$_SESSION['dim']="Some Value";

if(isset($dim)) 
  echo($dim);
else
  echo "Variable Not Set";


Expected result:

Variable Not Set

Actual result:
--
Windows IIS : Variable Not Set
Free BSD: Some Value





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


#26571 [Opn->Bgs]: func_get_arg(),func_get_args() fail to give value.

2003-12-09 Thread alan_k
 ID:   26571
 Updated by:   [EMAIL PROTECTED]
 Reported By:  Mentaloid at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Linux 2.4.22 SMP
 PHP Version:  4.3.3
 New Comment:

If you ever find out why - reopen it :)

Regards
Alan


Previous Comments:


[2003-12-09 23:23:00] Mentaloid at hotmail dot com

Hmm - I'm so embarrassed - this has problem has been buggin me for
days, I go and make a bug report and I can't reproduce it with my
original code that would for the life of me not work as expected. Now
it does. This is an exact copy - database included (binary innodb
copy). 

http://tko.mentadd.com/test/index.php

Sorry to bother you guys, I know your all real busy.



[2003-12-09 22:35:05] Mentaloid at hotmail dot com

I'm unable to reproduce using your code.. (the -r is unavailable on my
command line, so I droped it into a .php file and ran it that way). 

However, I'm also unable to reproduce it via a static ''
string, however it will not work with a string from a sql result.
strlen($fetch['test1']) shows 8 bytes, so I don't believe there is a
leading or trailing null. I will do some more investigating here, and
update with any more results I can dig up. The function I posted is as
is, but I'll see if I can setup a source that will reproduce this for
you. It could be a lot more source to sift through ;)



[2003-12-09 22:15:49] [EMAIL PROTECTED]

I cant reproduce this on php5 or php4.3.2-RC

Does this exhibit the same problem?
php -r 'function test() { print_r(func_get_args()); }
test("","");'





[2003-12-09 21:23:50] Mentaloid at hotmail dot com

Description:

When passing a string containing 8 bytes that represents hexadecimal
data such as '' to a user function that utilizes func_get_arg()
or func_get_arg(), values become unavailable (zero length string) while
func_num_args() will show that the value existed.

Configure Line "'./configure' '--with-mysql=/usr/local/mysql'
'--with-ftp' '--enable-sockets'
'--with-apxs2=/usr/local/apache2/bin/apxs'"

Apache 2.0, standard config + frontpage extensions. Frontpage
extensions not active on this virtualhost.
Standard INI, with the exception of ASP TAGS.

PHPInfo page can be viewed @
http://tko.mentadd.com/ServerControl/control/xxPhpInfo.php

Reproduce code:
---
function binlogdata() {
global $DB, $scbinlogtable;
$args = func_get_args();
$results = '';
foreach ($args as $key => $value) {
if ($key == 0) {
$results = $results.''.$value.'';
} else {
$results = 
$results.''.$value.'';
}
}
return $results;
}

$fetch['test1'] = 'thisisok';
$fetch['test2'] = '';

echo binlogdata('PlayerLimit',$fetch['test1'],$fetch['test2']);



Expected result:

// The expected result is
"PlayerLimitthisisok";


Actual result:
--
// The actual result is
"PlayerLimitthisisok";






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


#25831 [WFx]: overload/__call breaks method Pass by, and return by reference

2003-12-12 Thread alan_k
 ID:   25831
 Updated by:   [EMAIL PROTECTED]
-Summary:  overload/__call breaks method Pass by reference
 Reported By:  viking at dslnorthwest dot net
 Status:   Wont fix
 Bug Type: Scripting Engine problem
 Operating System: all
 PHP Version:  4.3.4RC2-dev
 New Comment:

Updating bug Title for reference
overload also breaks return by reference.


Previous Comments:


[2003-10-27 13:11:04] [EMAIL PROTECTED]

The issue was confirmed to have much to do with the current engine's
limitation. So then we're trying to make sure that this problem will be
fixed in php5.




[2003-10-10 22:12:29] [EMAIL PROTECTED]

simple script to reproduce:

pass_by_reference($message);
print "$message\n";



$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";


?>


should print 
Pass by reference works
Pass by reference works

actually prints
Pass by reference works
Pass by reference does not work!



[2003-10-10 19:30:28] viking at dslnorthwest dot net

Description:

When extending the DB_DataObject class using PHP 4.3.3, 
pass-by-reference calls to class methods don't work. 
After removing the call to overload() at the bottom of 
DB_DataObject.php, references work as expected. The 
following comments at the bottom of DB_DataObject 
allude to this:

// technially 4.3.2RC1 was broken!!
// looks like 4.3.3 may have problems too 
if ((phpversion() != '4.3.2-RC1') && (version_compare( 
phpversion(), "4.3.1") > 0)) {
   overload('DB_DataObject');
   $GLOBALS['_DB_DATAOBJECT']['OVERLOADED'] = true; 
}

Reproduce code:
---
require_once("DB/DataObject.php");

class no_problem
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

class problem extends DB_DataObject
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

$good = &new no_problem();
$bad = &new problem();

$message = "Pass by reference does not work!";
$good->pass_by_reference($message);
print "$message\n";

$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";

Expected result:

Pass by reference works 
Pass by reference works 

Actual result:
--
Pass by reference works 
Pass by reference does not work! 





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


#26627 [Opn->Bgs]: I get source of php files instead of supposed output on random basis

2003-12-15 Thread alan_k
 ID:   26627
 Updated by:   [EMAIL PROTECTED]
 Reported By:  info at gli dot ch
-Status:   Open
+Status:   Bogus
 Bug Type: Apache2 related
 Operating System: Linux 2.4.20
 PHP Version:  4.3.4
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

please read the support page and post a question to pear-general first.


Previous Comments:


[2003-12-15 04:42:17] info at gli dot ch

Description:


Randomly the php-source is displayed instead of the output
(http://www.engstringen.ch/).
This was the case when having installed apache 1.3 und php 4.1.

After ugrading to apache 2 and php 4.3.4 the bug still occurs. But the
browser shows now a file download dialog box for downloading the php
-script instead of having executed it !!!
The header of the response contains the php - mime type configured
application/x-httpd-php.

The apache config contains
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
Include conf/confixx_vhost.conf

The confixx_vhost.conf contains lots of virtual host configured on a
named vhost basis.


php is minimally configured with
 './configure' '--with-mysql' '--with-apxs'






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


#26734 [Ver->Bgs]: (or) and (||) not the same

2003-12-28 Thread alan_k
 ID:   26734
 Updated by:   [EMAIL PROTECTED]
 Reported By:  red at ixney dot net
-Status:   Verified
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Irrelevant
 PHP Version:  4.3.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

|| is boolean or
'or' is logical or

they are not the same



Previous Comments:


[2003-12-28 21:37:58] [EMAIL PROTECTED]

Nothing to do with Mysql, but more like a parser problem



Apparently || casts the resource to bool (true) and assigns it to the
variable. IMHO the || should either produce a parse error in this
context or behave like 'or'.




[2003-12-28 18:11:51] red at ixney dot net

Description:

I always thought '||' and 'or' was the same.
Combined with a mysql_query() however, they are not.

These lines are the same:
mysql_query("$var") or die("help!");
mysql_query("$var") || die("help!");
where $var is a DROP, INSERT or CREATE query, but they are *not* the
same if $var is a SELECT query; the returned value will not be a
'Resource ID' in the latter line.

Reproduce code:
---
mysql_query("DROP TABLE IF EXISTS foobar") || die('Cannot drop table');

mysql_query("CREATE TABLE IF NOT EXISTS foobar (foo INT NOT NULL
AUTO_INCREMENT, bar TINYINT(1), PRIMARY KEY (foo))") || die('Cannot
make table'); 

// Let's insert some random stuff
mysql_query("INSERT INTO foobar (bar) VALUES (0)") || die('Cannot add
values 1'); 
mysql_query("INSERT INTO foobar (bar) VALUES (1)") || die('Cannot add
values 2'); 
mysql_query("INSERT INTO foobar (bar) VALUES (0)") or die('Cannot add
values 3'); 
mysql_query("INSERT INTO foobar (bar) VALUES (1)") or die('Cannot add
values 4'); 

$handle1 = mysql_query("SELECT * FROM foobar WHERE 1") || die('Cannot
select'); 
$handle2 = mysql_query("SELECT * FROM foobar WHERE 1") or die('Cannot
select'); 

echo '$handle1 is '.$handle1.'';
echo '$handle2 is '.$handle2.'';

Expected result:

$handle1 is Resource id #2
$handle2 is Resource id #3

Actual result:
--
$handle1 is 1
$handle2 is Resource id #3





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


#26734 [Bgs]: (or) and (||) not the same

2003-12-31 Thread alan_k
 ID:   26734
 Updated by:   [EMAIL PROTECTED]
 Reported By:  red at ixney dot net
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Irrelevant
 PHP Version:  4.3.4
 New Comment:

Yeap - I was reading the engine source - as that is what they are
called there.. 

correct - the real difference is the precidence as documented pretty
well in the manual (and comments)



Previous Comments:


[2003-12-31 21:10:40] [EMAIL PROTECTED]

"boolean" and "logical" operators are the same thing (probably you
thought of bitwise operators like "|"). The difference between "||" and
"or" is the precedence.






[2003-12-28 22:14:16] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

|| is boolean or
'or' is logical or

they are not the same




[2003-12-28 21:37:58] [EMAIL PROTECTED]

Nothing to do with Mysql, but more like a parser problem



Apparently || casts the resource to bool (true) and assigns it to the
variable. IMHO the || should either produce a parse error in this
context or behave like 'or'.




[2003-12-28 18:11:51] red at ixney dot net

Description:

I always thought '||' and 'or' was the same.
Combined with a mysql_query() however, they are not.

These lines are the same:
mysql_query("$var") or die("help!");
mysql_query("$var") || die("help!");
where $var is a DROP, INSERT or CREATE query, but they are *not* the
same if $var is a SELECT query; the returned value will not be a
'Resource ID' in the latter line.

Reproduce code:
---
mysql_query("DROP TABLE IF EXISTS foobar") || die('Cannot drop table');

mysql_query("CREATE TABLE IF NOT EXISTS foobar (foo INT NOT NULL
AUTO_INCREMENT, bar TINYINT(1), PRIMARY KEY (foo))") || die('Cannot
make table'); 

// Let's insert some random stuff
mysql_query("INSERT INTO foobar (bar) VALUES (0)") || die('Cannot add
values 1'); 
mysql_query("INSERT INTO foobar (bar) VALUES (1)") || die('Cannot add
values 2'); 
mysql_query("INSERT INTO foobar (bar) VALUES (0)") or die('Cannot add
values 3'); 
mysql_query("INSERT INTO foobar (bar) VALUES (1)") or die('Cannot add
values 4'); 

$handle1 = mysql_query("SELECT * FROM foobar WHERE 1") || die('Cannot
select'); 
$handle2 = mysql_query("SELECT * FROM foobar WHERE 1") or die('Cannot
select'); 

echo '$handle1 is '.$handle1.'';
echo '$handle2 is '.$handle2.'';

Expected result:

$handle1 is Resource id #2
$handle2 is Resource id #3

Actual result:
--
$handle1 is 1
$handle2 is Resource id #3





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


#26760 [Opn->Fbk]: latest build breaks phpbb2 forum

2004-01-02 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5CVS-2004-01-01 (dev)
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

please look at detail what is causing the problem. - or contact the
support resources. www.php.net/support




Previous Comments:


[2004-01-02 02:00:45] eero at volotinen dot com

[01-Jan-2004 16:19:15] PHP Fatal error:  Class 'sql_db' not found in
/home/apache/www/forum/phpBB2/includes/db.php on line 60

What is broken, it worked in older build.



[2004-01-01 12:06:50] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.




[2004-01-01 11:07:58] eero at volotinen dot com

Description:

Latest build breaks phpbb2 forum.



Expected result:

Phpbb2 does not show anything.






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


#26760 [Opn->Fbk]: latest build breaks phpbb2 forum

2004-01-02 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5CVS-2004-01-01 (dev)
 New Comment:

can you test the simple script below.. - line 27 appears to be the
class definition line. 

test it with php -l test.php
(eg. syntax test it.)

.. if this works, go back to the mysql.php file, and remove chunks.
(eg. methods) and syntax test it - narrowing down the problem.




http://www.linux.ncp.fi/~eero/php_error/

I think problem was started on a few days builds.



[2004-01-02 02:28:57] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

please look at detail what is causing the problem. - or contact the
support resources. www.php.net/support





[2004-01-02 02:00:45] eero at volotinen dot com

[01-Jan-2004 16:19:15] PHP Fatal error:  Class 'sql_db' not found in
/home/apache/www/forum/phpBB2/includes/db.php on line 60

What is broken, it worked in older build.



[2004-01-01 12:06:50] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.




[2004-01-01 11:07:58] eero at volotinen dot com

Description:

Latest build breaks phpbb2 forum.



Expected result:

Phpbb2 does not show anything.






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


#26760 [Opn]: conditional class declartion causes syntax error

2004-01-02 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
-Summary:  latest build breaks phpbb2 forum
 Reported By:  eero at volotinen dot com
 Status:   Open
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5CVS-2004-01-01 (dev)
 New Comment:

Changing title.

I suspect marcus's fix broke this.
http://news.php.net/article.php?group=php.zend-engine.cvs&article=2159


Previous Comments:


[2004-01-02 05:07:53] eero at volotinen dot com

Used this test script:



Php reports error at line 7 which starts :

class sql_db ..



[2004-01-02 05:00:30] [EMAIL PROTECTED]

can you test the simple script below.. - line 27 appears to be the
class definition line. 

test it with php -l test.php
(eg. syntax test it.)

.. if this works, go back to the mysql.php file, and remove chunks.
(eg. methods) and syntax test it - narrowing down the problem.




http://www.linux.ncp.fi/~eero/php_error/

I think problem was started on a few days builds.



[2004-01-02 02:28:57] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.

please look at detail what is causing the problem. - or contact the
support resources. www.php.net/support





[2004-01-02 02:00:45] eero at volotinen dot com

[01-Jan-2004 16:19:15] PHP Fatal error:  Class 'sql_db' not found in
/home/apache/www/forum/phpBB2/includes/db.php on line 60

What is broken, it worked in older build.



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/26760

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


#26774 [Opn->Bgs]: toupper() funtion error

2004-01-02 Thread alan_k
 ID:   26774
 Updated by:   [EMAIL PROTECTED]
 Reported By:  chenkaipin at qy dot gd dot chinamobile dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: win 2000 server
 PHP Version:  4.3.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

see php.net/mbstring for working with chinese strings.


Previous Comments:


[2004-01-03 01:09:17] chenkaipin at qy dot gd dot chinamobile dot com

Description:

a string contain some CHINESE word named $name,when I use
$temp=toupper($name),it return the error string to me.eg.Ãô returns
ÃÔ¡£ 






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


#26760 [Bgs]: conditional class declartion causes syntax error

2004-01-05 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: linux 2.6
 PHP Version:  5CVS-2004-01-01 (dev)
 New Comment:

This appears to fix the nesting class without affecting conditional
definitions.


Index: zend_compile.c
===
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.507
diff -u -r1.507 zend_compile.c
--- zend_compile.c  3 Jan 2004 13:51:01 -   1.507
+++ zend_compile.c  5 Jan 2004 09:03:04 -
@@ -2315,6 +2315,11 @@
int doing_inheritance = 0;
zend_class_entry *new_class_entry =
emalloc(sizeof(zend_class_entry));
char *lcname =
zend_str_tolower_dup(class_name->u.constant.value.str.val,
class_name->u.constant.value.str.len);
+   
+   if (CG(active_class_entry) != NULL) {
+   efree(lcname);
+   zend_error(E_COMPILE_ERROR, "Cannot use nest class definitions");
+   }
 
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
Index: zend_language_parser.y
===
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.132
diff -u -r1.132 zend_language_parser.y
--- zend_language_parser.y  27 Dec 2003 22:59:49 -  1.132
+++ zend_language_parser.y  5 Jan 2004 09:03:05 -
@@ -168,7 +168,9 @@
 
 inner_statement:
statement
+   
|   function_declaration_statement
+   |   class_declaration_statement 
 ;
 
 



Previous Comments:


[2004-01-02 09:59:02] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As Derick said.



[2004-01-02 05:56:39] [EMAIL PROTECTED]

I don't think that anything is broken here. You just can't have a
conditional class definition (just like you can't instantiate a class
before it's declared anymore). 



[2004-01-02 05:26:04] [EMAIL PROTECTED]

Changing title.

I suspect marcus's fix broke this.
http://news.php.net/article.php?group=php.zend-engine.cvs&article=2159



[2004-01-02 05:07:53] eero at volotinen dot com

Used this test script:



Php reports error at line 7 which starts :

class sql_db ..



[2004-01-02 05:00:30] [EMAIL PROTECTED]

can you test the simple script below.. - line 27 appears to be the
class definition line. 

test it with php -l test.php
(eg. syntax test it.)

.. if this works, go back to the mysql.php file, and remove chunks.
(eg. methods) and syntax test it - narrowing down the problem.




http://bugs.php.net/26760

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


#26760 [Bgs]: conditional class declartion causes syntax error

2004-01-05 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: *
 PHP Version:  5.0.0RC1-dev
 New Comment:

Works ok here :)

it will leak memory (as it doesnt free the newly declared class).. but
since it fatal errors out anyway - it should be cleared  up on exit
?

[EMAIL PROTECTED]:/tmp$ php5 -r 'if (1) {class a{const x=1;static function
f(){return
1;}}}else{class a{const x=0;static function f(){return 0;}}}echo
a::x.a::f()."\n";'
11
[EMAIL PROTECTED]:/tmp$ php5 -r 'if (0) {class a{const x=1;static function
f(){return
1;}}}else{class a{const x=0;static function f(){return 0;}}}echo
a::x.a::f()."\n";'
00



Previous Comments:


[2004-01-05 09:24:42] [EMAIL PROTECTED]

The patch has a memleak and does not work correct. Please try the
following code:
php -r 'if (1) {class a{const x=1;static function f(){return
1;}}}else{class a{const x=0;static function f(){return 0;}}}echo
a::x.a::f()."\n";'
php -r 'if (0) {class a{const x=1;static function f(){return
1;}}}else{class a{const x=0;static function f(){return 0;}}}echo
a::x.a::f()."\n";'
Both print '00' but the first should obviously print '11'



[2004-01-05 04:00:05] [EMAIL PROTECTED]

This appears to fix the nesting class without affecting conditional
definitions.


Index: zend_compile.c
===
RCS file: /repository/ZendEngine2/zend_compile.c,v
retrieving revision 1.507
diff -u -r1.507 zend_compile.c
--- zend_compile.c  3 Jan 2004 13:51:01 -   1.507
+++ zend_compile.c  5 Jan 2004 09:03:04 -
@@ -2315,6 +2315,11 @@
int doing_inheritance = 0;
zend_class_entry *new_class_entry =
emalloc(sizeof(zend_class_entry));
char *lcname =
zend_str_tolower_dup(class_name->u.constant.value.str.val,
class_name->u.constant.value.str.len);
+   
+   if (CG(active_class_entry) != NULL) {
+   efree(lcname);
+   zend_error(E_COMPILE_ERROR, "Cannot use nest class definitions");
+   }
 
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
Index: zend_language_parser.y
===
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.132
diff -u -r1.132 zend_language_parser.y
--- zend_language_parser.y  27 Dec 2003 22:59:49 -  1.132
+++ zend_language_parser.y  5 Jan 2004 09:03:05 -
@@ -168,7 +168,9 @@
 
 inner_statement:
statement
+   
|   function_declaration_statement
+   |   class_declaration_statement 
 ;
 
 




[2004-01-02 09:59:02] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As Derick said.



[2004-01-02 05:56:39] [EMAIL PROTECTED]

I don't think that anything is broken here. You just can't have a
conditional class definition (just like you can't instantiate a class
before it's declared anymore). 



[2004-01-02 05:26:04] [EMAIL PROTECTED]

Changing title.

I suspect marcus's fix broke this.
http://news.php.net/article.php?group=php.zend-engine.cvs&article=2159



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/26760

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


#26760 [Bgs]: conditional class declartion causes syntax error

2004-01-06 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: *
 PHP Version:  5.0.0RC1-dev
 New Comment:

it appears the result is dependant on CR's

This produces 11

u.constant.value.str.val,
class_name->u.constant.value.str.len);
+   
+   if (CG(active_class_entry) != NULL) {
+   efree(lcname);
+   zend_error(E_COMPILE_ERROR, "Cannot use nest class definitions");
+   }
 
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
Index: zend_language_parser.y
===
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.132
diff -u -r1.132 zend_language_parser.y
--- zend_language_parser.y  27 Dec 2003 22:59:49 -  1.132
+++ zend_language_parser.y  5 Jan 2004 09:03:05 -
@@ -168,7 +168,9 @@
 
 inner_statement:
statement
+   
|   function_declaration_statement
+   |   class_declaration_statement 
 ;
 
 




[2004-01-02 09:59:02] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As Derick said.



[2004-01-02 05:56:39] [EMAIL PROTECTED]

I don't think that anything is broken here. You just can't have a
conditional class definition (just like you can't instantiate a class
before it's declared anymore). 



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/26760

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


#26760 [Bgs]: conditional class declartion causes syntax error

2004-01-06 Thread alan_k
 ID:   26760
 Updated by:   [EMAIL PROTECTED]
 Reported By:  eero at volotinen dot com
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: *
 PHP Version:  5.0.0RC1-dev
 New Comment:

php -r ' if (1) { function test () { echo "1"; }} else { function
test() { echo "0"; }} test();'

There is another bug here.. - the above all in one line will echo 0!)



Previous Comments:


[2004-01-06 06:41:39] [EMAIL PROTECTED]

it appears the result is dependant on CR's

This produces 11

u.constant.value.str.val,
class_name->u.constant.value.str.len);
+   
+   if (CG(active_class_entry) != NULL) {
+   efree(lcname);
+   zend_error(E_COMPILE_ERROR, "Cannot use nest class definitions");
+   }
 
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
Index: zend_language_parser.y
===
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.132
diff -u -r1.132 zend_language_parser.y
--- zend_language_parser.y  27 Dec 2003 22:59:49 -  1.132
+++ zend_language_parser.y  5 Jan 2004 09:03:05 -
@@ -168,7 +168,9 @@
 
 inner_statement:
statement
+   
|   function_declaration_statement
+   |   class_declaration_statement 
 ;
 
 




[2004-01-02 09:59:02] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

As Derick said.



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/26760

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


#26865 [Csd->Bgs]: PHP ini E_NOTICE setting ignored

2004-01-11 Thread alan_k
 ID:   26865
 Updated by:   [EMAIL PROTECTED]
 Reported By:  mmdrake at bctonline dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: PHP options/info functions
 Operating System: Windows
 PHP Version:  4.3.4
 New Comment:

Not bug -> bogus


Previous Comments:


[2004-01-11 23:43:44] mmdrake at bctonline dot com

So, so sorry; you're right and we didn't catch it.  We had copied some
code for one of our COM calls from an online example and there was a
statement in there for 'error_reporting'.  It didn't get caught because
it was in a different directory from the main code.

thanks.



[2004-01-11 08:32:05] [EMAIL PROTECTED]

Are you sure the error_reporting isn't overriden in the script? (with
call to ini_set() or error_reporting())




[2004-01-11 02:49:06] mmdrake at bctonline dot com

PHP.ini is being read.  I can change the error log name and have a new
file created.



[2004-01-10 20:29:15] [EMAIL PROTECTED]

The php.ini file is not being read at all.
Check your setup.




[2004-01-10 18:12:02] mmdrake at bctonline dot com

Description:

PHP.ini settings as listed below.

In spite of this, notices are written anyway, causing major performance
issues when a PHP-Gtk screen has several vars declared on the fly.

This worked at one point; no changes have been made to the way the
script is called (from a batch file, using php_gtk.exe wrapper); only
changes to the code.  Can't spot anything that might have this kind of
impact, where the ini file is basically ignored.

There is only one php.ini file on the machines, so no possibility of
wrong file being read.

Occurs in both WinNT and Win98.



Reproduce code:
---
PHP.ini has error logging on, with settings as follows:

error_reporting = E_ALL & ~E_NOTICE
log_errors = On
error_log = gtk_error.txt


Expected result:

NO NOTICES, only errors or warnings.

Actual result:
--
All notices are written to the error log, together with warnings and
errors.





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


#26875 [Bgs]: class, static keyword

2004-01-12 Thread alan_k
 ID:   26875
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jonas at datatal dot se
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: win2k
 PHP Version:  5.0.0b3 (beta3)
 New Comment:

E_STRICT is available, however, since parent::method() and
self::method() basically use the same infrastructure as static method
calls. - AFAIK putting in warnings in here may be problematic.. (and
adds another run-time performance hit..)




Previous Comments:


[2004-01-12 06:56:36] jonas at datatal dot se

How about adding an option the php.ini that does some stricter checking
in PHP5? (must declare variables, variables must exist, static keyword
must exist etc etc)



[2004-01-12 06:44:23] [EMAIL PROTECTED]

Wrong. It worked like that in PHP 4, of course it will work like this
in PHP 5. (BC)




[2004-01-12 03:15:15] jonas at datatal dot se

Description:

It is possible to call a class function directly dispite that it doesnt
have the static keyword.

Reproduce code:
---


Expected result:

Should only be possible if the function have been defined with the
static keyword.


Actual result:
--
The code works (it shouldnt).





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


#27119 [Opn->Bgs]: wrong sum result

2004-02-02 Thread alan_k
 ID:   27119
 Updated by:   [EMAIL PROTECTED]
 Reported By:  gnz at amorfo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: Windows/Linux
 PHP Version:  4.3.4
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.
 
Thank you for your interest in PHP.

try bcmath...


Previous Comments:


[2004-02-02 01:11:26] gnz at amorfo dot com

Description:

Hi, Im getting the wrong result performing a simple sum operation.
Ive been able to reproduce this on 
Windows with PHP 4.3.4
Windows with PHP 4.3.5 RC1
Linux with PHP 4.3.2


Reproduce code:
---



Expected result:

0.05

Actual result:
--
0.051





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


#27124 [Opn->Bgs]: Serious problem in php application

2004-02-02 Thread alan_k
 ID:   27124
 Updated by:   [EMAIL PROTECTED]
 Reported By:  info at websight-tech dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Performance problem
 Operating System: FreeBSD
 PHP Version:  4.3.4
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

please try the php-general mailing list first. - you will find alot
more help there for these types of issues.


Previous Comments:


[2004-02-03 01:28:21] info at websight-tech dot com

Description:

Hello,
   
I have a PHP web application. While Iam browse it through IE, when
I navigate through navigation buttons of the browser, I got some white
blank space in my page under the menu. Menu is a php file,I am
including it in my main file. Is it any problem related to the include
file.

If you want to recreate the problem,follow these steps.

1) url: www.quikmenu.com, browse it through IE

2)select "about us" link from menu

3)then simply go back with the back button of the browser, then u can
see a blank white space under the menu

In the about us page text in white sapce is the only thing that comes
from about.php. Rest of the whole thing in blue is come from a page
called uheader.php.

I hope you understand my problem. Could you please send the solution as
early as possible to 

[EMAIL PROTECTED]

Regards,
Websight Team.






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


#27148 [Opn]: a keyword (like print) is not allowed as method name

2004-02-05 Thread alan_k
 ID:   27148
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: Zend Engine 2 problem
 Operating System: linux
 PHP Version:  5CVS-2004-02-05 (dev)
 New Comment:

/home/alan# php -r 'class a { function print(){}}'
 
Parse error: parse error, expecting `T_STRING' in Command line code on
line 1
 
faxserver:/home/alan# php -v
PHP 4.3.2 (cli) (built: Jun  3 2003 11:24:43)
Copyright (c) 1997-2003 The PHP Group

I'm not sure how it could have worked with 4.3.5-dev.. - T_PRINT and
the associated grammer havent changed since it was first checked into
CVS




Previous Comments:


[2004-02-05 16:18:41] [EMAIL PROTECTED]

print, echo, die ...



[2004-02-04 13:07:36] [EMAIL PROTECTED]

Description:

PHP5 (HEAD) complains when a class has a method named print(). Looks
like the yacc grammar have to modified to allow that. The example code
works without problems with 4.3.5-dev

Reproduce code:
---
php -r 'class a { function print(){}}'

Expected result:

no error

Actual result:
--
PHP Parse error:  parse error, unexpected T_PRINT, expecting T_STRING
in Command line code on line 1





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


#27298 [Opn->Fbk]: easy to crash

2004-02-17 Thread alan_k
 ID:   27298
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sanry at now dot net dot cn
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: redhat 9
 PHP Version:  4.3.5RC3
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Theres not much can be done without information from the backtrace.



You could try checking the logs to see what pages where accessed before
it went down..


Previous Comments:


[2004-02-17 20:34:25] sanry at now dot net dot cn

Description:

php crash again ,this morning ( mpm= worker )

Reproduce code:
---
There so many vhost in this server ,I can't find it out

Expected result:

cript not found or unable to stat

script not found or unable to stat



Warning:  Unknown(): A session is active. You cannot change the
session module's ini settings at this time. in Unknown on line
0



Warning:  Unknown(): A session is active. You cannot change the
session module's ini settings at this time. in Unknown on line
0



Warning:  Unknown(): A session is active. You cannot change the
session module's ini settings at this time. in Unknown on line
0



Warning:  Unknown(): A session is active. You cannot change the
session module's ini settings at this time. in Unknown on line
0

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

script not found or unable to stat

[Wed Feb 18 06:10:40 2004] [notice] child pid 24354 exit signal
Segmentation fault (11)

[Wed Feb 18 08:12:58 2004] [warn] pid file
/usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown of
previous Apache run?

[Wed Feb 18 08:12:59 2004] [notice] Apache/2.0.48 (Unix) mod_jk/1.2.5
PHP/4.3.5RC3 configured -- resuming normal operations

script not found or unable to stat

[Wed Feb 18 09:29:08 2004] [notice] child pid 4787 exit signal
Segmentation fault (11)

[Wed Feb 18 09:54:33 2004] [warn] pid file
/usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown o

#22689 [Opn->Bgs]: function registration falied - duplicate name

2003-03-13 Thread alan_k
 ID:   22689
 Updated by:   [EMAIL PROTECTED]
 Reported By:  c-g at uol dot com dot br
-Status:   Open
+Status:   Bogus
 Bug Type: IIS related
 Operating System: NT 4 Svpk 6
 PHP Version:  4.3.1
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

remove the extension = php_gd.dll from php.ini or remove dl('gd.dll')
from your php code - it's built into the binary.


Previous Comments:


[2003-03-13 20:40:24] c-g at uol dot com dot br

Sorry for my english, is terrifc...

After the instalation of PHP version, i can't run .php pages

the browser send me Message Box with the above messages


function registration falied - duplicate name - gd_info
function registration falied - duplicate name - imagearc
function registration falied - duplicate name - imageellipse
function registration falied - duplicate name - imagechar
function registration falied - duplicate name - imagecharup
function registration falied - duplicate name - imagecolorallocate
function registration falied - duplicate name - imagepalettecopy
function registration falied - duplicate name - imagecreateformstring
function registration falied - duplicate name - imagecolorat
function registration falied - duplicate name - imagecolorclosest
function registration falied - duplicate name - imagecolordeallocate
function registration falied - duplicate name - imagecolorresolve
function registration falied - duplicate name - imagecolorexact
function registration falied - duplicate name - imagecolorset
function registration falied - duplicate name - imagecolortransparent
function registration falied - duplicate name - imagecolorstotal
function registration falied - duplicate name - imagecolorsforindex
function registration falied - duplicate name - imagecopy
function registration falied - duplicate name - imagecopymerge
function registration falied - duplicate name - imagecopymergegray
function registration falied - duplicate name - imagecopyresized
function registration falied - duplicate name - imagecreate
function registration falied - duplicate name - imagesetstyle
function registration falied - duplicate name - imagecreateformpng
function registration falied - duplicate name - imagecreateformjpeg
function registration falied - duplicate name - imagecreateformwbmp
function registration falied - duplicate name - imagecreateformgd
function registration falied - duplicate name - imagecreateformgd2
function registration falied - duplicate name - imagecreateformgd2part
function registration falied - duplicate name - imagepng
function registration falied - duplicate name - imagejpeg
function registration falied - duplicate name - imagewbmp
function registration falied - duplicate name - imagegd
function registration falied - duplicate name - imagegd2
function registration falied - duplicate name - imagedestroy
function registration falied - duplicate name - imagegammacorrect
function registration falied - duplicate name - imagefill
function registration falied - duplicate name - imagefilledpolygon
function registration falied - duplicate name - imagefiledrectangle
function registration falied - duplicate name - imagefilltoborder
function registration falied - duplicate name - imagefontwidth
function registration falied - duplicate name - imagefontheight
function registration falied - duplicate name - imageinterlace
function registration falied - duplicate name - imageline
function registration falied - duplicate name - imageloadfont
function registration falied - duplicate name - imagepolygon
function registration falied - duplicate name - imagerectangle
function registration falied - duplicate name - imagesetpixel
function registration falied - duplicate name - imagestring
function registration falied - duplicate name - imagestringup
function registration falied - duplicate name - imagesx
function registration falied - duplicate name - imagesy
function registration falied - duplicate name - imageashedline
function registration falied - duplicate name - imagettfbbox
function registration falied - duplicate name - imagettftext
function registration falied - duplicate name - imagetypes
function registration falied - duplicate name - jpeg2wbmp
function registration falied - duplicate name - png2wbmp
function registration falied - duplicate name - image2wbmp
gd: unable to register function, unable to load





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



#32789 [Opn->Bgs]: array_pop doesn't work correctly

2005-04-23 Thread alan_k
 ID:   32789
 Updated by:   [EMAIL PROTECTED]
 Reported By:  php at thoftware dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Arrays related
 Operating System: *
 PHP Version:  4.3.11
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

bugs is not a helpdesk - please leave this as bogus and ask on
php-general.


Previous Comments:


[2005-04-22 15:56:37] php at thoftware dot de

Sorry again, maybe I should stop coding %-(, this is the real 

Actual result:
--
it's forever mine
noone else should be able to change it
it's mine
this is my cache

for the example directly above ...



[2005-04-22 15:54:09] php at thoftware dot de

Sorry, the fatal error results from the result of cache() being an
empty array (but that may be another bug?), correct code should be:

Reproduce code:
---
class foobar {
  var $cache = array();
  function cache() {
if (!count($this->cache)) {
  $this->cache[1] = array(
'this is my cache',
'it\'s mine',
'noone else should be able to change it',
'it\'s forever mine',
  );
}
return($this->cache[1]);
  }
}
$foobar =& new foobar();
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());

Expected result:

it's forever mine 
it's forever mine 
it's forever mine 
it's forever mine

Actual result:
--
Fatal error: Only variables can be passed by reference in ...

Using a static variable within the method will work like the example
using a plain function, using an object-variable will work like shown
above, even if you remove the '[1]'-part.



[2005-04-22 15:46:13] php at thoftware dot de

And again using an object:

Reproduce code:
---
class foobar {
  var $cache = array();
  function cache() {
if (!isset($this->cache)) {
  $this->cache = array(
'this is my cache',
'it\'s mine',
'noone else should be able to change it',
'it\'s forever mine',
  );
}
return($this->cache);
  }
}
$foobar =& new foobar();
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());
echo array_pop($foobar->cache());

Expected result:

it's forever mine 
it's forever mine 
it's forever mine 
it's forever mine

Actual result:
--
Fatal error: Only variables can be passed by reference in ...

Using a static variable within the method will work like the example
using a plain function, using an object-variable causes a fatal error.



[2005-04-22 15:38:05] php at thoftware dot de

How about this one?

Reproduce code:
---
function cache() {
  static $cache=array();
  if (!count($cache)) {
$cache[1] = array(
  'this is my cache',
  'it\'s mine',
  'noone else should be able to change it',
  'it\'s forever mine',
);
  }
  return($cache[1]);
}
echo array_pop(cache());
echo array_pop(cache());
echo array_pop(cache());
echo array_pop(cache());

Expected result:

it's forever mine 
it's forever mine 
it's forever mine 
it's forever mine

Actual result:
--
it's forever mine 
noone else should be able to change it 
it's mine 
this is my cache

Note: If you remove the '[1]'-part, it works as expected. I think this
part of the problem is not an array_pop()-bug but a bug within the
reference-system?



[2005-04-22 14:31:53] php at thoftware dot de

The variables in the object must not be changed! That's the reason why
I don't use &cache()! Either should PHP state that it's not allowed to
use cache() as an argument for array_pop() or array_pop() shouldn't
change the data of the object because cache isn't supposed to return a
reference.

Look at the first example - expected result is an unchanged object
resp. an error-message. The second example was only to show to you,
that PHP recognizes that the method _isn't_ passed as a variable when
it is assigned to a variable before (that's bogus in my eyes).

Why do you make this bug-report bogus? I'm sorry for my maybe bad
english, but is it really not understandable what I'm trying to
explain? Then you may s

#32841 [Asn->WFx]: returned a member variable cannot be turned into reference

2005-04-28 Thread alan_k
 ID:   32841
 Updated by:   [EMAIL PROTECTED]
 Reported By:  wagner at bonn dot edu
-Status:   Assigned
+Status:   Wont fix
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  4.3.11, 5.0.4
 Assigned To:  andi
 New Comment:

What you are trying to do is feasable in  different ways. - just not
the way you are trying.. (try the support channels for suggestions.) 
- whether what you are trying to do is a good idea (maintance, code
readability, creating bugs) is another question...

changing the engine behavior to do what you say is extremely complex.
And the return on fixing this would not be worth the instability that
it would involve (we know from previous efforts at looking at this).

hint: use
return &$this->var; 
$tmp = &$foo->f_default();
incr($tmp);




Previous Comments:


[2005-04-28 06:34:50] wagner at bonn dot edu

> In your case f_default() returns *copy*, not a reference   
No it doesn't.   
   
Try this as case 1 in the reproduce code as above: 
-- 
 case 1:   
   //forced reference works AND makes default behaviour 
   //work afterwards   
   echo incr($foo->f_ref())."\n";   
   echo incr($foo->f_default())."\n";   
   echo incr($foo->f_default())."\n";   
   break;   
   
Expected result:  
  
1  
2  
2  
f_default() should return a copy 
  
Actual result: 
-- 
1 
2 
3 
incr() gets a reference to $foo->v and modifies it 
 
Since I filed this behaviour as another bug here 
http://bugs.php.net/bug.php?id=32840 
could it please be looked at too and be unbogusified?



[2005-04-27 23:45:04] [EMAIL PROTECTED]

Short version: 
this is expected and the error message clearly says why:
only variables can be referenced and you cannot make a reference to an
expression result.
Long version:
In your case f_default() returns *copy*, not a reference as you wrongly
consider, while f_ref() returns reference and should work indeed.
But I'm a bit surprised to see that f_copy() works, as it should give
the same warning as with f_default().
Concerning the case 2, AFAIK it's because of some reference magic: when
you return $this->v as reference, it turns in refernce itself
(refcount++) and the following call to f_default() returns this
reference.
Though, it would be interesting to see what engine gurus say about it.



[2005-04-26 14:54:41] wagner at bonn dot edu

Description:

When returning a member-variable directly as a reference   
parameter into a function, a fatal error occurs:   
Fatal error: Only variables can be passed by reference ...  
The reproduce code displays the bug (for $case=0) as well 
as two simple workarounds that IMHO show that the 
ZEND-Engine should be able to handle this with no need for 
any error. 
This seems to have been around for a while, at least PHP 
4.3.x  
Probably related to 
http://bugs.php.net/bug.php?id=32840 

Reproduce code:
---
$case = 0;

function incr(&$int) {
  return $int++;
}

class foo {
  var $v = 1;
  function &f_ref() { return $this->v; }
  function f_copy() { return (int)$this->v; } //forced copy through
type-cast
  function f_default() { return $this->v; }
}

$foo =& new foo();
switch($case) {
 case 0:
  //default behaviour is broken
  echo incr($foo->f_default())."\n";
 case 1:
   //forced reference works AND makes default behaviour work
afterwards
   echo incr($foo->f_ref())."\n";
   echo incr($foo->f_default())."\n";
   break;
 case 2:
   //forced copy works
   echo incr($foo->f_copy())."\n";
   break;
}

Expected result:

incr() should get a copy of $foo->v 

Actual result:
--
Fatal error: Only variables can be passed by reference in 
foo.php on line 19 
 





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


#32638 [Bgs]: objects cast as string explictly require a __toString when __call is defined

2005-05-09 Thread alan_k
 ID:   32638
 Updated by:   [EMAIL PROTECTED]
 Reported By:  jason at amp-design dot net
 Status:   Bogus
 Bug Type: Zend Engine 2 problem
 Operating System: CentOS
 PHP Version:  5.0.4
 New Comment:

It's supposed to get fixed, but it's not regarded as critical, just
annoying, so It has to annoy a developer  enough to fix it


Previous Comments:


[2005-05-09 16:14:18] jason at amp-design dot net

Out of interest/curiousity, when a bug is marked as 'bogus', what does
that mean? Although you state it's currently the expected behaviour,
are you suggesting that this could change in future releases in the
long term (i.e. next major release) maybe when you go over and review
certain issues. You seem to suggest that this might be the case in the
second from last comment in http://bugs.php.net/bug.php?id=30791.



[2005-04-14 09:40:53] [EMAIL PROTECTED]

Dupe of #30791



[2005-04-14 09:20:04] [EMAIL PROTECTED]

This is expected behaviour because __call() catches all undefined
methods, including magic ones like __toString().
You have to define __toString() or fix __call() to return appropriate
string representation of the object.



[2005-04-08 19:49:47] jason at amp-design dot net

Description:

This produces an error that should not happen. Instead, when you cast
an object to a string that has no __toString defined, it should produce
the objects internal ID. Oddly enough, the behaviour is inconsistent as
...

class A {
public function __call($name, $args) {echo $name;}
}
echo (new A);

seems to work as expected. I can't see how this should behave
differently from dereferencing from a variable. 

I guess the behaviour of string casting is undefined for objects that
do not have __toString() defined, so I guess it is debateable if this
is really a bug, or a querky language "feature" ;-)

Note that this will work if one returns a value for __call().

Reproduce code:
---


Expected result:

Object id #insert_number_here

Actual result:
--
__tostring
Fatal error: Method A::__toString() must return a string value in
/data/test.php on line 21





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


#33065 [Opn]: overloading

2005-05-20 Thread alan_k
 ID:   33065
 Updated by:   [EMAIL PROTECTED]
 Reported By:  cita at nextradsl dot cz
 Status:   Open
 Bug Type: Class/Object related
 Operating System: independent
 PHP Version:  5.0.4
 New Comment:

you need to provide a reproducable example, eg. so
#php -r your_example.php
runs and illustrates your problem.


Previous Comments:


[2005-05-20 00:38:39] cita at nextradsl dot cz

example code with comments is here:

http://citadesign.site.cz/9file/php-bug/bug.sphp

and sorry for my english



[2005-05-19 23:41:01] [EMAIL PROTECTED]

Please provide a short but complete reproduce script then.



[2005-05-19 23:32:36] cita at nextradsl dot cz

same problem is still there!



[2005-05-19 20:35:55] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-05-19 16:11:56] cita at nextradsl dot cz

I tested it at PHP 5.0.4, problem is same



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/33065

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


#33065 [Bgs]: overloading

2005-05-20 Thread alan_k
 ID:   33065
 Updated by:   [EMAIL PROTECTED]
 Reported By:  cita at nextradsl dot cz
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: independent
 PHP Version:  5.0.4
 New Comment:

ask zend...


Previous Comments:


[2005-05-20 21:49:05] cita at nextradsl dot cz

sorry if you lost time with my problem, but i'm testing without
optimizer, i using clear instalation of php and apache, but on
application server i must use optimizer for better performace. that my
last question is: Could i run some version of optimizer on php 5.1 ?



[2005-05-20 21:43:22] [EMAIL PROTECTED]

Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

Thank you for wasting my time.



[2005-05-20 21:38:56] cita at nextradsl dot cz

sure, yes i have,  but latest version of optimizer don't support php
version 5.1,  is version of optimizer for php 5.1 ?



[2005-05-20 21:24:35] [EMAIL PROTECTED]

Do you have Zend Optimizer enabled ?



[2005-05-20 21:23:20] cita at nextradsl dot cz

ok, sorry latest stable 5.0 is produce error,
but latest 5.1 is worikng, but there i have problem with zend optimizer



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/33065

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


#33093 [Fbk]: token_get_all() inconsistent results?

2005-05-21 Thread alan_k
 ID:   33093
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: Mac OS X 10.4.1
 PHP Version:  5.0.4
 New Comment:

Actually the tokenizer just plugs into the internal tokenize code used
by the engine. As such, the engine doesnt need to know some
information, and is written to work as quickly and effeciently as
possible, rather than being 100% dead on for parsing.

It's unlikely to be fixed just for token_get_all(), as introducing
changes can have quite radical effects sometimes when touching that bit
of code.

The values with the tokens should enable you to get the CR/LF count
ok.. 


Previous Comments:


[2005-05-22 05:51:20] [EMAIL PROTECTED]

wheres the missing data?

php -r 'var_dump(token_get_all(""));'
array(6) {
  [0]=>
  array(2) {
[0]=>
int(366)
[1]=>
string(6) "
  array(2) {
[0]=>
int(316)
[1]=>
string(4) "echo"
  }
  [2]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [3]=>
  array(2) {
[0]=>
int(309)
[1]=>
string(4) "$var"
  }
  [4]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [5]=>
  array(2) {
[0]=>
int(368)
[1]=>
string(2) "?>"
  }
}




php -r 'var_dump(token_get_all(""));'
array(7) {
  [0]=>
  array(2) {
[0]=>
int(366)
[1]=>
string(6) "
  array(2) {
[0]=>
int(369)
[1]=>
string(1) "
"
  }
  [2]=>
  array(2) {
[0]=>
int(316)
[1]=>
string(4) "echo"
  }
  [3]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [4]=>
  array(2) {
[0]=>
int(309)
[1]=>
string(4) "$var"
  }
  [5]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) "
"
  }
  [6]=>
  array(2) {
[0]=>
int(368)
[1]=>
string(2) "?>"
  }




[2005-05-21 18:40:38] [EMAIL PROTECTED]

Description:

It appears that token_get_all() does not report T_OPEN_TAG and
T_WHITESPACE properly, depending on the whitespace following the
opening tag.  For example, when parsing ...



... you get T_OPEN_TAG, T_ECHO, T_WHITESPACE, T_VAR, T_WHITESPACE, and
T_CLOSE_TAG.  This is not entirely the expected result (I would expect
T_WHITESPACE between the open tag and the echo).

However, when parsing the functional equivalent...



you get "<", "?", T_STRING ("php"), T_WHITESPACE, T_ECHO, T_WHITESPACE,
T_VAR, T_WHITESPACE, and T_CLOSE_TAG.  In addition, the first whitespace
value reported does not include all the newlines (it drops one).

Although Macs use \r for their newlines natively, the test code uses
the Unix-standard \n, so I don't think it's Mac-related.

If this is in fact a bug, the current behavior makes it difficult to
write a reliable userland code auditor and report proper line numbers.

Am I missing some assumptions behind the behavior of the tokenizer
function?






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


#33093 [Opn->Fbk]: token_get_all() inconsistent results?

2005-05-21 Thread alan_k
 ID:   33093
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: Mac OS X 10.4.1
 PHP Version:  5.0.4
 New Comment:

wheres the missing data?

php -r 'var_dump(token_get_all(""));'
array(6) {
  [0]=>
  array(2) {
[0]=>
int(366)
[1]=>
string(6) "
  array(2) {
[0]=>
int(316)
[1]=>
string(4) "echo"
  }
  [2]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [3]=>
  array(2) {
[0]=>
int(309)
[1]=>
string(4) "$var"
  }
  [4]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [5]=>
  array(2) {
[0]=>
int(368)
[1]=>
string(2) "?>"
  }
}




php -r 'var_dump(token_get_all(""));'
array(7) {
  [0]=>
  array(2) {
[0]=>
int(366)
[1]=>
string(6) "
  array(2) {
[0]=>
int(369)
[1]=>
string(1) "
"
  }
  [2]=>
  array(2) {
[0]=>
int(316)
[1]=>
string(4) "echo"
  }
  [3]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) " "
  }
  [4]=>
  array(2) {
[0]=>
int(309)
[1]=>
string(4) "$var"
  }
  [5]=>
  array(2) {
[0]=>
int(369)
[1]=>
string(1) "
"
  }
  [6]=>
  array(2) {
[0]=>
int(368)
[1]=>
string(2) "?>"
  }



Previous Comments:


[2005-05-21 18:40:38] [EMAIL PROTECTED]

Description:

It appears that token_get_all() does not report T_OPEN_TAG and
T_WHITESPACE properly, depending on the whitespace following the
opening tag.  For example, when parsing ...



... you get T_OPEN_TAG, T_ECHO, T_WHITESPACE, T_VAR, T_WHITESPACE, and
T_CLOSE_TAG.  This is not entirely the expected result (I would expect
T_WHITESPACE between the open tag and the echo).

However, when parsing the functional equivalent...



you get "<", "?", T_STRING ("php"), T_WHITESPACE, T_ECHO, T_WHITESPACE,
T_VAR, T_WHITESPACE, and T_CLOSE_TAG.  In addition, the first whitespace
value reported does not include all the newlines (it drops one).

Although Macs use \r for their newlines natively, the test code uses
the Unix-standard \n, so I don't think it's Mac-related.

If this is in fact a bug, the current behavior makes it difficult to
write a reliable userland code auditor and report proper line numbers.

Am I missing some assumptions behind the behavior of the tokenizer
function?






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


#33197 [Fbk->Opn]: sapi_module.treat_data not getting initialized (apache2)

2005-05-31 Thread alan_k
 ID:   33197
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Apache2 related
 Operating System: debian / linux
 PHP Version:  5.* (2005-05-31)
 New Comment:

Workaround : main/php_variables.c

add this to php_hash_enviroment()
if (!sapi_module.treat_data) {
   php_startup_sapi_content_types();
}

If no-one else can reproduce this, then it's probably best to suspend
it. (eg. leave open for a few days..)

Reference information:
gcc version 3.3.5 (Debian 1:3.3.5-12)
ii  apache2-common 2.0.54-4   
ii  apache2-mpm-prefork 2.0.54-4 
ii  apache2-prefork-dev  2.0.54-4 
ii  libtool1.5.6-6 
ii  autoconf   2.59a-3 







Previous Comments:


[2005-05-31 07:41:33] [EMAIL PROTECTED]

Try this:
# ./configure --disable-all --with-apxs2 

And if above crashes:
# ./configure --disable-all --with-apxs2 --enable-debug 




[2005-05-31 07:34:59] alan at akbkhome dot com

Server version: Apache/2.0.54
it's the debain apache2-mpm-prefork



[2005-05-31 07:29:33] [EMAIL PROTECTED]

Not enough info to reproduce (works fine for me..).
What MPM is used for Apache2? (please tell it's worker? :)
What startup? Request or "apachectl start" ?




[2005-05-31 06:01:23] alan at akbkhome dot com

Description:

tried HEAD & php-5.0.4

getting segfault at startup with apache2
#1  0x4086a123 in php_hash_environment ()
at /usr/src/php-5.0.4/main/php_variables.c:625
p = 0x81ecc39 "GPCS"
_gpc_flags = "\000\000\000\001"
dummy_track_vars_array = (zval *) 0x0
initialized_dummy_track_vars_array = 0 '\0'
jit_initialization = 0 '\0'
auto_global_records = {{name = 0x40a0c39b "_POST", name_len =
6,
long_name = 0x40a236b2 "HTTP_POST_VARS", long_name_len = 15,
jit_initialization = 0 '\0'}, {name = 0x40a0c3a1 "_GET", name_len =
5,
long_name = 0x40a236c1 "HTTP_GET_VARS", long_name_len = 14,
jit_initialization = 0 '\0'}, {name = 0x40a0c393 "_COOKIE",
name_len = 8,
long_name = 0x40a236cf "HTTP_COOKIE_VARS", long_name_len = 17,
jit_initialization = 0 '\0'}, {name = 0x408c12ab "_SERVER",
name_len = 8,
long_name = 0x40a236e0 "HTTP_SERVER_VARS", long_name_len = 17,
jit_initialization = 1 '\001'}, {name = 0x40a1683e "_ENV", name_len
= 5,
long_name = 0x40a236f1 "HTTP_ENV_VARS", long_name_len = 14,
jit_initialization = 1 '\001'}, {name = 0x40a23708 "_FILES",
name_len = 7,
long_name = 0x40a236ff "HTTP_POST_FILES", long_name_len = 16,
jit_initialization = 0 '\0'}}
i = 6
#2  0x4085edc4 in php_request_startup () at
/usr/src/php-5.0.4/main/main.c:1060
orig_bailout = {{__jmpbuf = {135586232, 1084715676,
-1073743140,
  -1073743112, -1073743568, 1082911454}, __mask_was_saved = 0,
__saved_mask = {__val = {0 
orig_bailout_set = 1 '\001'
retval = 0
#3  0x408bedfb in php_handler (r=0x8221948)
at /usr/src/php-5.0.4/sapi/apache2handler/sapi_apache2.c:527
orig_bailout = {{__jmpbuf = {0, 0, 0, 0, 0, 0},
__mask_was_saved = 0,
__saved_mask = {__val = {0 
ctx = (php_struct *) 0x8223240
conf = (void *) 0x0
brigade = (apr_bucket_brigade *) 0x82232b8
bucket = (apr_bucket *) 0x0
rv = 0
parent_req = (request_rec *) 0x0
#4  0x080783d5 in ap_run_handler ()
No symbol table info available.
(gdb) up
#1  0x4086a123 in php_hash_environment ()
at /usr/src/php-5.0.4/main/php_variables.c:625
625
sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);/* GET
Data */
(gdb)  print sapi_module.treat_data
$2 = (void (*)(int, char *, zval *)) 0


build:
 './configure' 
'--prefix=/usr'
 '--with-regex=php'
 '--disable-cgi' 

'--with-config-file-path=/etc/php5/cli' 
'--disable-rpath'
 '--enable-memory-limit' 
'--with-layout=GNU'
 '--with-pear=/usr/share/php'
 '--enable-track-vars'
 '--enable-trans-sid' 
'--enable-bcmath'
 '--with-bz2' 
'--enable-ctype' '
--with-db4' 
'--with-iconv' 
'--enable-exif'
 '--enable-ftp' 
'--with-gettext' 
'--enable-mbstring'
 '--with-pcre-regex=/usr'
 '--enable-shmop'
 '--enable-sockets'
 '--enable-wddx'
 '--disable-xml'
 '--with-expat-dir=/usr'
 '--with-xmlrpc' 
'--enable-yp' 
'--with-zlib' 
'--without-pgsql'
 '--with-kerberos=/usr' 
'--enable-dbx' '--with-mime-magic=/usr/share/misc/file/magic.mime'
'--with-exec-dir=/usr/lib/php5/libexec' 
'--disable-static'
 '--without-mm'
 '--without-mysql'
 '--without-sybase-ct' 
'--enable-curl'
 '--with-apxs2=/usr/bin/apxs2'
 '--without-sqlite'
 '--without-pdo-sqlite'




Reproduce code:
---
 



---

#31106 [Opn]: 4.3.10 - crashes with overloaded objects

2004-12-15 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
-Summary:  apache2  - execute dtor'ing something wrong.
 Reported By:  alan at akbkhome dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 New Comment:

change title to be more precise..


Previous Comments:


[2004-12-16 08:04:45] alan at akbkhome dot com

This fixes it.

--- zend_execute.c  2004-12-16 15:18:16.0 +0800
+++ zend_execute.c.fixed2004-12-16 15:18:28.0 +0800
@@ -996,7 +996,6 @@
}
   
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
-   PZVAL_UNLOCK(T->EA.data.overloaded_element.object);
 }



[2004-12-16 01:36:21] alan at akbkhome dot com

Description:

config with apache2 fork
I need to isolate the code causing this, - but it appears to be a
common segfault, on more than just one page.

php4.3.7 runs fine. - exactly the same config

  './configure' '--with-apxs2=/usr/bin/apxs2' '--prefix=/usr'
'--with-regex=php' '--with-config-file-path=/etc/php4/apache'
'--disable-rpath' '--disable-debug' '--enable-memory-limit'
'--with-layout=GNU' '--enable-calendar' '--enable-sysvsem'
'--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid'
'--enable-bcmath' '--with-bz2' '--with-db4' '--with-iconv'
'--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext'
'--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop'
'--enable-sockets' '--enable-wddx' '--with-expat-dir=/usr'
'--enable-yp' '--with-zlib' '--without-pgsql' '--with-openssl=/usr'
'--disable-static' '--with-zlib-dir=/usr' '--with-mysql=/usr'
'--with-ming=/usr'

full backtrace:

#0  0x4040a264 in mallopt () from /lib/libc.so.6
#1  0x4040907f in free () from /lib/libc.so.6
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
#5  0x4072e23c in _zval_ptr_dtor (zval_ptr=0x408e0df0) at
/usr/src/php-4.3.10/Zend/zend_execute_API.c:289
#6  0x40744748 in execute (op_array=0x82f3a7c) at
zend_execute_locks.h:26
#7  0x407468c4 in execute (op_array=0x82f3a14) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#8  0x407468c4 in execute (op_array=0x824799c) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#9  0x407468c4 in execute (op_array=0x8247344) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#10 0x407468c4 in execute (op_array=0x82419e4) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#11 0x40736971 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php-4.3.10/Zend/zend.c:900
#12 0x40708a1f in php_execute_script (primary_file=0xba50) at
/usr/src/php-4.3.10/main/main.c:1736
#13 0x4074bb8c in php_handler (r=0x8235478) at
/usr/src/php-4.3.10/sapi/apache2handler/sapi_apache2.c:542
#14 0x080782b5 in ap_run_handler ()
#15 0x08189a68 in ?? ()
(gdb) bt full
#0  0x4040a264 in mallopt () from /lib/libc.so.6
No symbol table info available.
#1  0x4040907f in free () from /lib/libc.so.6
No symbol table info available.
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
p = (zend_mem_header *) 0x8472698
real_size = 138880672
cache_index = 138880664
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
p = (Bucket *) 0x0
q = (Bucket *) 0x84727bc
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
No locals.
#5  0x4072e23c in _zval_ptr_dtor (zval_ptr=0x408e0df0) at
/usr/src/php-4.3.10/Zend/zend_execute_API.c:289
No locals.
#6  0x40744748 in execute (op_array=0x82f3a7c) at
zend_execute_locks.h:26
execute_data = {opline = 0x8307708, function_state =
{function_symbol_table = 0x82481fc, function = 0x82f3a7c,
reserved = {0x408d8678, 0x408a085b, 0x82432f4, 0xbfffb358}}, fbc =
0x0, ce = 0x0, object = {ptr = 0x0},
  Ts = 0xbfff914c, original_in_execution = 1 '\001', op_array =
0x82f3a7c, prev_execute_data = 0xbfffb760}
#7  0x407468c4 in execute (op_array=0x82f3a14) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
calling_symbol_table = (HashTable *) 0x82c2644
original_return_value = (zval **) 0xbfffc554
execute_data = {opline = 0x827d480, function_state =
{function_symbol_table = 0x82432f4, function = 0x82f3a7c,
reserved = {0x408d8678, 0x408a085b, 0x82c2644, 0xbfffb7b8}}, fbc =
0x82f3a7c, ce = 0x0, object = {
ptr = 0x82fcf5c}, Ts = 0xbfffb37c, original_in_execution = 1
'\001', op_array = 0x82f3a14,
  prev_execute_data = 0xbfffcdb0}
#8  0x407468c4 in execute (op_array=0x824799c) at
/usr/src/php-4.3.10/Zend/zend_exec

#31119 [Opn]: php crashes apache2 child and chrashes in interactive mode

2004-12-16 Thread alan_k
 ID:   31119
 Updated by:   [EMAIL PROTECTED]
 Reported By:  shoorik at ilyichevsk dot net
 Status:   Open
 Bug Type: Apache2 related
 Operating System: FreeBSD 5.2.1-RELEASE #5 i386
 PHP Version:  4.3.10
 New Comment:

can you try the changes recommended on this
http://bugs.php.net/bug.php?id=31106


Previous Comments:


[2004-12-16 13:16:57] shoorik at ilyichevsk dot net

Prefork mpm works nice, but I must solve few issues with CGI zombies
using threads that way. Thats why I tried to use worker mpm. Anyway -
there is few sites which still work on threaded php - I got this crash
only with phpMyAdmin (still trying to find out WHERE?).

So I must not use thread features anyway... Sadly... Will PHP team fix
this is fuftre anyway? Perl story reproduces?



[2004-12-16 13:04:03] [EMAIL PROTECTED]

Does it crash if you compile Apache with prefork mpm ?? ie. don't even
try to use threading with php, it doesn't work.




[2004-12-16 12:29:55] shoorik at ilyichevsk dot net

Description:

Apache httpd-2.0.52 config:
configure --prefix=/usr/local/apache --enable-suexec
--enable-ext-filter --enable-rewrite --enable-ssl --with-mpm=worker
--enable-threads

NOTE: apache built with worker MPM!

PHP config:
configure  --with-mysql=/usr/local/mysql
--with-apxs2=/usr/local/apache/bin/apxs --with-gd=/usr/local
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib=/usr
--with-iconv=/usr/local --with-freetype=/usr/local
--with-curl=/usr/local --enable-threads --enable-roxen-zts

Bug reproducible on phpMyAdmin-2.6.0-pl3. Requests to phpMyAdmin using
web causes apache chield to die with signal 11.


[Thu Dec 16 10:51:52 2004] [notice] child pid 69976 exit signal Illegal
instruction (4)


Crash also could be reproduced in cmd line using "php -a index.php"
command. But in non-interactive mode (without -a option) it works.

Backtrace see below

This crash also reproducible with PHP-4.3.6 using same configureaion.
4.3.6 crashes with the same backtrace.


Actual result:
--
su-2.05b# pwd
/home/web/xx.xx.xx.xx/www/phpMyAdmin-2.6.0-pl3
su-2.05b# php -v
PHP 4.3.10 (cli) (built: Dec 16 2004 10:50:26)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
su-2.05b# gdb `which php`
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) r -a index.php
Starting program: /usr/local/bin/php -a index.php
Interactive mode enabled


Program received signal SIGSEGV, Segmentation fault.
0x0813a7d3 in execute (op_array=0x83b760c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:1093
1093switch(EX(opline)->opcode) {


(gdb) bt
#0  0x0813a7d3 in execute (op_array=0x83b760c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:1093
#1  0x0813e50e in execute (op_array=0x83b718c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:2212
#2  0x08126e81 in execute_new_code (tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute_API.c:712
#3  0x08113ed1 in zendparse (tsrm_ls=0x8189050) at
Zend/zend_language_parser.c:2191
#4  0x08117a52 in compile_file (file_handle=0xbfbfc500, type=8,
tsrm_ls=0x8189050) at Zend/zend_language_scanner.c:3111
#5  0x0813e7f4 in execute (op_array=0x823aa8c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:2163
#6  0x08126e81 in execute_new_code (tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute_API.c:712
#7  0x08113ed1 in zendparse (tsrm_ls=0x8189050) at
Zend/zend_language_parser.c:2191
#8  0x08117a52 in compile_file (file_handle=0xbfbfec14, type=2,
tsrm_ls=0x8189050) at Zend/zend_language_scanner.c:3111
#9  0x0812e041 in zend_execute_scripts (type=8, tsrm_ls=0x8189050,
retval=0x0, file_count=3)
at /usr/local/src/php-4.3.10/Zend/zend.c:896
#10 0x0810151e in php_execute_script (primary_file=0xbfbfec14,
tsrm_ls=0x8189050)
at /usr/local/src/php-4.3.10/main/main.c:1736
#11 0x081424f9 in main (argc=3, argv=0xbfbfec74) at
/usr/local/src/php-4.3.10/sapi/cli/php_cli.c:822
#12 0x080618d2 in _start ()
(gdb)






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


#31106 [Fbk]: 4.3.10 - crashes with overloaded objects

2004-12-17 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
 Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 Assigned To:  stas
 New Comment:

I'll try and get a test case done over the weekend..

should be quite simple - create a overloaded object (with __call) - and
assign some vars's then set it so something else.. (based on a rough
guess)..

The real code is a bit to complex for a simple test case - but it broke
both my devel servers. ;)


Previous Comments:


[2004-12-17 11:23:05] [EMAIL PROTECTED]

Can you provide some example of the code that crashes? Of course I'd
prefer the code that I could run, so that I can check what's the
problem.

Removing unlock won't do good - it would just cause a memory leak.



[2004-12-16 09:57:55] [EMAIL PROTECTED]

Actually both changes in this commit cause big problems with overloaded
objects

http://cvs.php.net/diff.php/Zend/Attic/zend_execute.c?sa=1&r1=1.316.2.41&r2=1.316.2.42&ty=u

removing 1st fixes crashes
removing 2nd fixes object properties getting destroyed/lost? when
calling methods of overloaded objects.



[2004-12-16 08:12:44] [EMAIL PROTECTED]

change title to be more precise..



[2004-12-16 08:04:45] alan at akbkhome dot com

This fixes it.

--- zend_execute.c  2004-12-16 15:18:16.0 +0800
+++ zend_execute.c.fixed2004-12-16 15:18:28.0 +0800
@@ -996,7 +996,6 @@
}
   
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
-   PZVAL_UNLOCK(T->EA.data.overloaded_element.object);
 }



[2004-12-16 01:36:21] alan at akbkhome dot com

Description:

config with apache2 fork
I need to isolate the code causing this, - but it appears to be a
common segfault, on more than just one page.

php4.3.7 runs fine. - exactly the same config

  './configure' '--with-apxs2=/usr/bin/apxs2' '--prefix=/usr'
'--with-regex=php' '--with-config-file-path=/etc/php4/apache'
'--disable-rpath' '--disable-debug' '--enable-memory-limit'
'--with-layout=GNU' '--enable-calendar' '--enable-sysvsem'
'--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid'
'--enable-bcmath' '--with-bz2' '--with-db4' '--with-iconv'
'--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext'
'--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop'
'--enable-sockets' '--enable-wddx' '--with-expat-dir=/usr'
'--enable-yp' '--with-zlib' '--without-pgsql' '--with-openssl=/usr'
'--disable-static' '--with-zlib-dir=/usr' '--with-mysql=/usr'
'--with-ming=/usr'

full backtrace:

#0  0x4040a264 in mallopt () from /lib/libc.so.6
#1  0x4040907f in free () from /lib/libc.so.6
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
#5  0x4072e23c in _zval_ptr_dtor (zval_ptr=0x408e0df0) at
/usr/src/php-4.3.10/Zend/zend_execute_API.c:289
#6  0x40744748 in execute (op_array=0x82f3a7c) at
zend_execute_locks.h:26
#7  0x407468c4 in execute (op_array=0x82f3a14) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#8  0x407468c4 in execute (op_array=0x824799c) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#9  0x407468c4 in execute (op_array=0x8247344) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#10 0x407468c4 in execute (op_array=0x82419e4) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#11 0x40736971 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php-4.3.10/Zend/zend.c:900
#12 0x40708a1f in php_execute_script (primary_file=0xba50) at
/usr/src/php-4.3.10/main/main.c:1736
#13 0x4074bb8c in php_handler (r=0x8235478) at
/usr/src/php-4.3.10/sapi/apache2handler/sapi_apache2.c:542
#14 0x080782b5 in ap_run_handler ()
#15 0x08189a68 in ?? ()
(gdb) bt full
#0  0x4040a264 in mallopt () from /lib/libc.so.6
No symbol table info available.
#1  0x4040907f in free () from /lib/libc.so.6
No symbol table info available.
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
p = (zend_mem_header *) 0x8472698
real_size = 138880672
cache_index = 138880664
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
p = (Bucket *) 0x0
q = (Bucket *) 0x84727bc
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
No locals.
#5  0x4072e23c in _zval_ptr_dto

#31106 [Opn->Asn]: 4.3.10 - crashes with overloaded objects

2004-12-17 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
-Status:   Open
+Status:   Assigned
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 Assigned To:  stas


Previous Comments:


[2004-12-17 17:58:06] alan at akbkhome dot com

nice simple test case .. - causes segfault

x = $s;
   }
   function __call($a,$b,&$c) {
echo "$a";
return FALSE;
   }
}
overload('DBO');

$a = DBO::factory();
$a->w('test');
$a->bbb = 0;



[2004-12-17 13:00:49] [EMAIL PROTECTED]

I'll try and get a test case done over the weekend..

should be quite simple - create a overloaded object (with __call) - and
assign some vars's then set it so something else.. (based on a rough
guess)..

The real code is a bit to complex for a simple test case - but it broke
both my devel servers. ;)



[2004-12-17 11:23:05] [EMAIL PROTECTED]

Can you provide some example of the code that crashes? Of course I'd
prefer the code that I could run, so that I can check what's the
problem.

Removing unlock won't do good - it would just cause a memory leak.



[2004-12-16 09:57:55] [EMAIL PROTECTED]

Actually both changes in this commit cause big problems with overloaded
objects

http://cvs.php.net/diff.php/Zend/Attic/zend_execute.c?sa=1&r1=1.316.2.41&r2=1.316.2.42&ty=u

removing 1st fixes crashes
removing 2nd fixes object properties getting destroyed/lost? when
calling methods of overloaded objects.



[2004-12-16 08:12:44] [EMAIL PROTECTED]

change title to be more precise..



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/31106

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


#31106 [Asn]: alan_k

2004-12-17 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
-Summary:  4.3.10 - crashes with overloaded objects
 Reported By:  alan at akbkhome dot com
 Status:   Assigned
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 Assigned To:  stas
 New Comment:

nope - it affects cgi/cli/apache/apache2 all the same - segfault..
'connection lost' is the end user experience of the apache process
segfaulting.


Previous Comments:


[2004-12-18 01:29:51] alan at aardwolfweb dot com

On Apache 1.3.29 the error doesn't seem quite as severe, 
overloading appears to just not work, I'm getting "call to 
undefined method" errors.  Or "connection broken".



[2004-12-17 17:58:06] alan at akbkhome dot com

nice simple test case .. - causes segfault

x = $s;
   }
   function __call($a,$b,&$c) {
echo "$a";
return FALSE;
   }
}
overload('DBO');

$a = DBO::factory();
$a->w('test');
$a->bbb = 0;



[2004-12-17 13:00:49] [EMAIL PROTECTED]

I'll try and get a test case done over the weekend..

should be quite simple - create a overloaded object (with __call) - and
assign some vars's then set it so something else.. (based on a rough
guess)..

The real code is a bit to complex for a simple test case - but it broke
both my devel servers. ;)



[2004-12-17 11:23:05] [EMAIL PROTECTED]

Can you provide some example of the code that crashes? Of course I'd
prefer the code that I could run, so that I can check what's the
problem.

Removing unlock won't do good - it would just cause a memory leak.



[2004-12-16 09:57:55] [EMAIL PROTECTED]

Actually both changes in this commit cause big problems with overloaded
objects

http://cvs.php.net/diff.php/Zend/Attic/zend_execute.c?sa=1&r1=1.316.2.41&r2=1.316.2.42&ty=u

removing 1st fixes crashes
removing 2nd fixes object properties getting destroyed/lost? when
calling methods of overloaded objects.



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/31106

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


#31106 [Opn]: 4.3.10 - crashes with overloaded objects

2004-12-16 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 New Comment:

Actually both changes in this commit cause big problems with overloaded
objects

http://cvs.php.net/diff.php/Zend/Attic/zend_execute.c?sa=1&r1=1.316.2.41&r2=1.316.2.42&ty=u

removing 1st fixes crashes
removing 2nd fixes object properties getting destroyed/lost? when
calling methods of overloaded objects.


Previous Comments:


[2004-12-16 08:12:44] [EMAIL PROTECTED]

change title to be more precise..



[2004-12-16 08:04:45] alan at akbkhome dot com

This fixes it.

--- zend_execute.c  2004-12-16 15:18:16.0 +0800
+++ zend_execute.c.fixed2004-12-16 15:18:28.0 +0800
@@ -996,7 +996,6 @@
}
   
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
-   PZVAL_UNLOCK(T->EA.data.overloaded_element.object);
 }



[2004-12-16 01:36:21] alan at akbkhome dot com

Description:

config with apache2 fork
I need to isolate the code causing this, - but it appears to be a
common segfault, on more than just one page.

php4.3.7 runs fine. - exactly the same config

  './configure' '--with-apxs2=/usr/bin/apxs2' '--prefix=/usr'
'--with-regex=php' '--with-config-file-path=/etc/php4/apache'
'--disable-rpath' '--disable-debug' '--enable-memory-limit'
'--with-layout=GNU' '--enable-calendar' '--enable-sysvsem'
'--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid'
'--enable-bcmath' '--with-bz2' '--with-db4' '--with-iconv'
'--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext'
'--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop'
'--enable-sockets' '--enable-wddx' '--with-expat-dir=/usr'
'--enable-yp' '--with-zlib' '--without-pgsql' '--with-openssl=/usr'
'--disable-static' '--with-zlib-dir=/usr' '--with-mysql=/usr'
'--with-ming=/usr'

full backtrace:

#0  0x4040a264 in mallopt () from /lib/libc.so.6
#1  0x4040907f in free () from /lib/libc.so.6
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
#5  0x4072e23c in _zval_ptr_dtor (zval_ptr=0x408e0df0) at
/usr/src/php-4.3.10/Zend/zend_execute_API.c:289
#6  0x40744748 in execute (op_array=0x82f3a7c) at
zend_execute_locks.h:26
#7  0x407468c4 in execute (op_array=0x82f3a14) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#8  0x407468c4 in execute (op_array=0x824799c) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#9  0x407468c4 in execute (op_array=0x8247344) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#10 0x407468c4 in execute (op_array=0x82419e4) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
#11 0x40736971 in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /usr/src/php-4.3.10/Zend/zend.c:900
#12 0x40708a1f in php_execute_script (primary_file=0xba50) at
/usr/src/php-4.3.10/main/main.c:1736
#13 0x4074bb8c in php_handler (r=0x8235478) at
/usr/src/php-4.3.10/sapi/apache2handler/sapi_apache2.c:542
#14 0x080782b5 in ap_run_handler ()
#15 0x08189a68 in ?? ()
(gdb) bt full
#0  0x4040a264 in mallopt () from /lib/libc.so.6
No symbol table info available.
#1  0x4040907f in free () from /lib/libc.so.6
No symbol table info available.
#2  0x40726d7f in _efree (ptr=0x84726ac) at
/usr/src/php-4.3.10/Zend/zend_alloc.c:265
p = (zend_mem_header *) 0x8472698
real_size = 138880672
cache_index = 138880664
#3  0x4073b3df in zend_hash_destroy (ht=0x843b0cc) at
/usr/src/php-4.3.10/Zend/zend_hash.c:566
p = (Bucket *) 0x0
q = (Bucket *) 0x84727bc
#4  0x40735084 in _zval_dtor (zvalue=0x8437774) at
/usr/src/php-4.3.10/Zend/zend_variables.c:60
No locals.
#5  0x4072e23c in _zval_ptr_dtor (zval_ptr=0x408e0df0) at
/usr/src/php-4.3.10/Zend/zend_execute_API.c:289
No locals.
#6  0x40744748 in execute (op_array=0x82f3a7c) at
zend_execute_locks.h:26
execute_data = {opline = 0x8307708, function_state =
{function_symbol_table = 0x82481fc, function = 0x82f3a7c,
reserved = {0x408d8678, 0x408a085b, 0x82432f4, 0xbfffb358}}, fbc =
0x0, ce = 0x0, object = {ptr = 0x0},
  Ts = 0xbfff914c, original_in_execution = 1 '\001', op_array =
0x82f3a7c, prev_execute_data = 0xbfffb760}
#7  0x407468c4 in execute (op_array=0x82f3a14) at
/usr/src/php-4.3.10/Zend/zend_execute.c:1686
calling_symbol_table = (HashTable *) 0x82c2644
original_return_value = (zval **) 0xbfffc554
execute_data = {opline = 0x827d480, function_state =
{function_symbol

#31119 [Opn]: php crashes apache2 child and chrashes in interactive mode

2004-12-16 Thread alan_k
 ID:   31119
 Updated by:   [EMAIL PROTECTED]
 Reported By:  shoorik at ilyichevsk dot net
 Status:   Open
 Bug Type: Apache2 related
 Operating System: FreeBSD 5.2.1-RELEASE #5 i386
 PHP Version:  4.3.10
 New Comment:

ah.. - just saw you had the same problem with 4.3.6 - the easiest (well
not that easy) way to isolate the problem is to find the last working
version, go through the major changes. - unless someone pop's up with a
answer sooner..



Previous Comments:


[2004-12-16 13:48:25] shoorik at ilyichevsk dot net

--- zend_execute.c.orig Thu Dec 16 12:30:49 2004
+++ zend_execute.c  Thu Dec 16 12:33:57 2004
@@ -997,5 +997,5 @@ static void call_overloaded_function(tem
   
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
-   PZVAL_UNLOCK(T->EA.data.overloaded_element.object);
+/* PZVAL_UNLOCK(T->EA.data.overloaded_element.object); */
 }


has no effect. still crashes. or I missunderstood something?



[2004-12-16 13:28:55] [EMAIL PROTECTED]

can you try the changes recommended on this
http://bugs.php.net/bug.php?id=31106



[2004-12-16 13:16:57] shoorik at ilyichevsk dot net

Prefork mpm works nice, but I must solve few issues with CGI zombies
using threads that way. Thats why I tried to use worker mpm. Anyway -
there is few sites which still work on threaded php - I got this crash
only with phpMyAdmin (still trying to find out WHERE?).

So I must not use thread features anyway... Sadly... Will PHP team fix
this is fuftre anyway? Perl story reproduces?



[2004-12-16 13:04:03] [EMAIL PROTECTED]

Does it crash if you compile Apache with prefork mpm ?? ie. don't even
try to use threading with php, it doesn't work.




[2004-12-16 12:29:55] shoorik at ilyichevsk dot net

Description:

Apache httpd-2.0.52 config:
configure --prefix=/usr/local/apache --enable-suexec
--enable-ext-filter --enable-rewrite --enable-ssl --with-mpm=worker
--enable-threads

NOTE: apache built with worker MPM!

PHP config:
configure  --with-mysql=/usr/local/mysql
--with-apxs2=/usr/local/apache/bin/apxs --with-gd=/usr/local
--with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib=/usr
--with-iconv=/usr/local --with-freetype=/usr/local
--with-curl=/usr/local --enable-threads --enable-roxen-zts

Bug reproducible on phpMyAdmin-2.6.0-pl3. Requests to phpMyAdmin using
web causes apache chield to die with signal 11.


[Thu Dec 16 10:51:52 2004] [notice] child pid 69976 exit signal Illegal
instruction (4)


Crash also could be reproduced in cmd line using "php -a index.php"
command. But in non-interactive mode (without -a option) it works.

Backtrace see below

This crash also reproducible with PHP-4.3.6 using same configureaion.
4.3.6 crashes with the same backtrace.


Actual result:
--
su-2.05b# pwd
/home/web/xx.xx.xx.xx/www/phpMyAdmin-2.6.0-pl3
su-2.05b# php -v
PHP 4.3.10 (cli) (built: Dec 16 2004 10:50:26)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
su-2.05b# gdb `which php`
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) r -a index.php
Starting program: /usr/local/bin/php -a index.php
Interactive mode enabled


Program received signal SIGSEGV, Segmentation fault.
0x0813a7d3 in execute (op_array=0x83b760c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:1093
1093switch(EX(opline)->opcode) {


(gdb) bt
#0  0x0813a7d3 in execute (op_array=0x83b760c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:1093
#1  0x0813e50e in execute (op_array=0x83b718c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:2212
#2  0x08126e81 in execute_new_code (tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute_API.c:712
#3  0x08113ed1 in zendparse (tsrm_ls=0x8189050) at
Zend/zend_language_parser.c:2191
#4  0x08117a52 in compile_file (file_handle=0xbfbfc500, type=8,
tsrm_ls=0x8189050) at Zend/zend_language_scanner.c:3111
#5  0x0813e7f4 in execute (op_array=0x823aa8c, tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute.c:2163
#6  0x08126e81 in execute_new_code (tsrm_ls=0x8189050) at
/usr/local/src/php-4.3.10/Zend/zend_execute_API.c:7

#31214 [Opn]: overloading using __call() initially OK, fails on any subsequent method call

2004-12-20 Thread alan_k
 ID:   31214
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ebypdx at comcast dot net
 Status:   Open
 Bug Type: Class/Object related
 Operating System: Solaris 5.8
 PHP Version:  4.3.10
 New Comment:

a) make sure you are not using any Zend extension eg.
Optimizer/xdebug/apc etc. 

have a look at this report 
http://bugs.php.net/?id=31106

see if reverting the mentioned change to zend_execute fixes this.


Previous Comments:


[2004-12-21 02:28:35] ebypdx at comcast dot net

I've also seen it fail out with a different fatal error "call to
undefined function".  i can't determine how to make it do this instead
of giving "call on a non-object."



[2004-12-21 02:26:26] ebypdx at comcast dot net

Description:

in the most simple case, create a class with no methods except __call()
and overload it.  start calling methods on an instance of that class. 
the first method call will hit __call() and finish correctly.  any
subsequent method calls will fail to hit __call(), resulting instead in
a fatal error.

if this is indeed a bug... i realize due to the experimental nature of
overloading in 4.3, that this may never work again.  my deepest thanks
to anybody who can address this.

Reproduce code:
---
$method ";
$returnValue = "return";
return true;
}
}
overload("BaseOverloader");
$c = new BaseOverloader();
$c->firstCall();
$c->secondCall();
?>

Expected result:

Call to BaseOverloader->firstcall
Call to BaseOverloader->secondcall

Actual result:
--
Call to baseoverloader->firstcall

Fatal error: Call to a member function on a non-object in
/export/vol01/opt/web/neby/partner.newedgenetworks.com/overloaded.php
on line 13






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


#31214 [Opn->Fbk]: overloading using __call() initially OK, fails on any subsequent method call

2004-12-20 Thread alan_k
 ID:   31214
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ebypdx at comcast dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Class/Object related
 Operating System: Solaris 5.8
 PHP Version:  4.3.10


Previous Comments:


[2004-12-21 02:35:50] [EMAIL PROTECTED]

a) make sure you are not using any Zend extension eg.
Optimizer/xdebug/apc etc. 

have a look at this report 
http://bugs.php.net/?id=31106

see if reverting the mentioned change to zend_execute fixes this.



[2004-12-21 02:28:35] ebypdx at comcast dot net

I've also seen it fail out with a different fatal error "call to
undefined function".  i can't determine how to make it do this instead
of giving "call on a non-object."



[2004-12-21 02:26:26] ebypdx at comcast dot net

Description:

in the most simple case, create a class with no methods except __call()
and overload it.  start calling methods on an instance of that class. 
the first method call will hit __call() and finish correctly.  any
subsequent method calls will fail to hit __call(), resulting instead in
a fatal error.

if this is indeed a bug... i realize due to the experimental nature of
overloading in 4.3, that this may never work again.  my deepest thanks
to anybody who can address this.

Reproduce code:
---
$method ";
$returnValue = "return";
return true;
}
}
overload("BaseOverloader");
$c = new BaseOverloader();
$c->firstCall();
$c->secondCall();
?>

Expected result:

Call to BaseOverloader->firstcall
Call to BaseOverloader->secondcall

Actual result:
--
Call to baseoverloader->firstcall

Fatal error: Call to a member function on a non-object in
/export/vol01/opt/web/neby/partner.newedgenetworks.com/overloaded.php
on line 13






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


#31214 [Opn]: overloading using __call() initially OK, fails on any subsequent method call

2004-12-20 Thread alan_k
 ID:   31214
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ebypdx at comcast dot net
 Status:   Open
 Bug Type: Class/Object related
 Operating System: Solaris 5.8
 PHP Version:  4.3.10
 New Comment:

in Zend/zend_execute.c

about line 997: remove this line
PZVAL_UNLOCK(T->EA.data.overloaded_element.object);

about line 1579: remove this line

EX(object).ptr->refcount++;

you have to copy & paste the whole link for it to work / rather than
just pressing on it.



Previous Comments:


[2004-12-21 02:45:16] ebypdx at comcast dot net

i believe we aren't using any of those extensions.  i will double-check
with the sysadmin team.

can you give me a tip on how to revert that change?  when i follow the
link to cvsweb from report 31106 i get a "malformed query" page.



[2004-12-21 02:35:50] [EMAIL PROTECTED]

a) make sure you are not using any Zend extension eg.
Optimizer/xdebug/apc etc. 

have a look at this report 
http://bugs.php.net/?id=31106

see if reverting the mentioned change to zend_execute fixes this.



[2004-12-21 02:28:35] ebypdx at comcast dot net

I've also seen it fail out with a different fatal error "call to
undefined function".  i can't determine how to make it do this instead
of giving "call on a non-object."



[2004-12-21 02:26:26] ebypdx at comcast dot net

Description:

in the most simple case, create a class with no methods except __call()
and overload it.  start calling methods on an instance of that class. 
the first method call will hit __call() and finish correctly.  any
subsequent method calls will fail to hit __call(), resulting instead in
a fatal error.

if this is indeed a bug... i realize due to the experimental nature of
overloading in 4.3, that this may never work again.  my deepest thanks
to anybody who can address this.

Reproduce code:
---
$method ";
$returnValue = "return";
return true;
}
}
overload("BaseOverloader");
$c = new BaseOverloader();
$c->firstCall();
$c->secondCall();
?>

Expected result:

Call to BaseOverloader->firstcall
Call to BaseOverloader->secondcall

Actual result:
--
Call to baseoverloader->firstcall

Fatal error: Call to a member function on a non-object in
/export/vol01/opt/web/neby/partner.newedgenetworks.com/overloaded.php
on line 13






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


#31278 [Opn->Fbk]: Segmentation Fault when string is echoed

2004-12-23 Thread alan_k
 ID:   31278
 Updated by:   [EMAIL PROTECTED]
 Reported By:  developer at ckiweb dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Gentoo
 PHP Version:  4.3.10
 New Comment:

Please try using this CVS snapshot:

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


Previous Comments:


[2004-12-24 02:41:20] developer at ckiweb dot com

The is something else that has to be in the code.  After the echo line,
place print_r($t).



[2004-12-24 02:39:33] developer at ckiweb dot com

Description:

I was trying to debug a problem in the DB_DataObject class in PEAR,
when I got a segmentation fault.  It occurs everytime when I try to
echo a string greater than 10 characters.

Reproduce code:
---
In the Generator.php file (in the DB_DataObject-1.7.2 class in PEAR) on
line 126 (right after $t->_createTableList();), place a line similar to
this:

echo 'aoeuidhtns'."\n";

The amount of characters has to be 10 or greater.

Expected result:

I would expect the line to appear and the program to keep parsing.

Actual result:
--
The line is echod and then I get a Segmentation Fault





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


#31278 [Fbk->Csd]: Segmentation Fault when string is echoed

2004-12-23 Thread alan_k
 ID:   31278
 Updated by:   [EMAIL PROTECTED]
 Reported By:  developer at ckiweb dot com
-Status:   Feedback
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: Gentoo
 PHP Version:  4.3.10
 New Comment:

it's a known bug of 4.3.10 which has been fixed now


Previous Comments:


[2004-12-24 02:41:54] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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



[2004-12-24 02:41:20] developer at ckiweb dot com

The is something else that has to be in the code.  After the echo line,
place print_r($t).



[2004-12-24 02:39:33] developer at ckiweb dot com

Description:

I was trying to debug a problem in the DB_DataObject class in PEAR,
when I got a segmentation fault.  It occurs everytime when I try to
echo a string greater than 10 characters.

Reproduce code:
---
In the Generator.php file (in the DB_DataObject-1.7.2 class in PEAR) on
line 126 (right after $t->_createTableList();), place a line similar to
this:

echo 'aoeuidhtns'."\n";

The amount of characters has to be 10 or greater.

Expected result:

I would expect the line to appear and the program to keep parsing.

Actual result:
--
The line is echod and then I get a Segmentation Fault





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


#31278 [Csd->Bgs]: Segmentation Fault when string is echoed

2004-12-23 Thread alan_k
 ID:   31278
 Updated by:   [EMAIL PROTECTED]
 Reported By:  developer at ckiweb dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: Reproducible crash
 Operating System: Gentoo
 PHP Version:  4.3.10
 New Comment:

OK - official line is that duplicate bugs are bogus :)


Previous Comments:


[2004-12-24 02:44:04] [EMAIL PROTECTED]

it's a known bug of 4.3.10 which has been fixed now



[2004-12-24 02:41:54] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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



[2004-12-24 02:41:20] developer at ckiweb dot com

The is something else that has to be in the code.  After the echo line,
place print_r($t).



[2004-12-24 02:39:33] developer at ckiweb dot com

Description:

I was trying to debug a problem in the DB_DataObject class in PEAR,
when I got a segmentation fault.  It occurs everytime when I try to
echo a string greater than 10 characters.

Reproduce code:
---
In the Generator.php file (in the DB_DataObject-1.7.2 class in PEAR) on
line 126 (right after $t->_createTableList();), place a line similar to
this:

echo 'aoeuidhtns'."\n";

The amount of characters has to be 10 or greater.

Expected result:

I would expect the line to appear and the program to keep parsing.

Actual result:
--
The line is echod and then I get a Segmentation Fault





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


#31106 [Csd]: 4.3.10 - crashes with overloaded objects

2004-12-23 Thread alan_k
 ID:   31106
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
 Status:   Closed
 Bug Type: Reproducible crash
 Operating System: linux
 PHP Version:  4.3.10
 Assigned To:  stas
 New Comment:

Yeap - confirmed - this is fixed


Previous Comments:


[2004-12-21 11:38:53] [EMAIL PROTECTED]

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the test case. I believe I have fixed it.



[2004-12-18 03:10:05] [EMAIL PROTECTED]

nope - it affects cgi/cli/apache/apache2 all the same - segfault..
'connection lost' is the end user experience of the apache process
segfaulting.



[2004-12-17 17:58:06] alan at akbkhome dot com

nice simple test case .. - causes segfault

x = $s;
   }
   function __call($a,$b,&$c) {
echo "$a";
return FALSE;
   }
}
overload('DBO');

$a = DBO::factory();
$a->w('test');
$a->bbb = 0;



[2004-12-17 13:00:49] [EMAIL PROTECTED]

I'll try and get a test case done over the weekend..

should be quite simple - create a overloaded object (with __call) - and
assign some vars's then set it so something else.. (based on a rough
guess)..

The real code is a bit to complex for a simple test case - but it broke
both my devel servers. ;)



[2004-12-17 11:23:05] [EMAIL PROTECTED]

Can you provide some example of the code that crashes? Of course I'd
prefer the code that I could run, so that I can check what's the
problem.

Removing unlock won't do good - it would just cause a memory leak.



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/31106

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


#31214 [NoF]: overloading using __call() initially OK, fails on any subsequent method call

2005-01-07 Thread alan_k
 ID:   31214
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ebypdx at comcast dot net
 Status:   No Feedback
 Bug Type: Class/Object related
 Operating System: Solaris 5.8
 PHP Version:  4.3.10
 New Comment:

try snaps.php.net - this should be fixed now.


Previous Comments:


[2005-01-07 03:41:33] patrick at arkeon dot com

A "not real" solution about the "Call to a member function on a
non-object"

Try this:
// Only to avoid the problem...
class Dummy { 
function Dummy() {
}
}
$toto =& new Dummy();

class BaseOverloader {
function BaseOverloader() {}
function __call($method, $args, &$returnValue) {
echo "Call to ".get_class($this)."->$method ";
$returnValue = "return";
return true;
}
}
overload("BaseOverloader");
$toto = new BaseOverloader();
$toto->firstCall();
$toto->secondCall();

Then you got:
Call to baseoverloader->firstcall 
Call to baseoverloader->secondcall 

Weird, no?!?



[2004-12-29 01:00:16] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2004-12-21 18:05:49] [EMAIL PROTECTED]

leave bug @ feedback until further information is known.



[2004-12-21 17:33:51] ebypdx at comcast dot net

thanks very much for the feedback, if our sysadmins have time to apply
that patch i'll post back the results.  for now we've rolled back a
version.



[2004-12-21 03:58:03] [EMAIL PROTECTED]

Try the patch listed in bug report #31106



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/31214

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


#30791 [Opn->Ver]: alan_k

2005-01-12 Thread alan_k
 ID:   30791
 Updated by:   [EMAIL PROTECTED]
-Summary:  overload and serialize produce unexpected behaviour
 Reported By:  alan at akbkhome dot com
-Status:   Open
+Status:   Verified
 Bug Type: Zend Engine 2 problem
 Operating System: na
 PHP Version:  5CVS-2004-11-15 (dev)
 New Comment:

Changing to verified - although it's not critical (as overload was
experimental in 4.x) it is a BC break - and is a relatively unexpected
behaviour..


Previous Comments:


[2005-01-13 02:10:25] alan at akbkhome dot com

Marcus already confirmed this needs fixing - the serialize code should
not end up calling __call() on overloaded objects.



[2005-01-13 00:02:03] [EMAIL PROTECTED]

>If an object is overloaded (with __call()), then >serializ'ing the
object will fail unless __sleep() is defined.
.. or unless __call() returns Array of instance names.

I'd say there is no bug, 'cos your overloaded __sleep() method indeed
returns wrong data.



[2004-11-15 09:57:51] alan at akbkhome dot com

Description:

If an object is overloaded (with __call()), then serializ'ing the
object will fail unless __sleep() is defined.

It would be far clearer to either
a) - force __sleep to defined on overloaded objects (E_WARN?)
b) - dont call __call() with the __sleep() request.



Reproduce code:
---
class a {
   public $a = 4;
   function __call($a,$b) {
   return "unknown method";
   }
}
$b = new a;
echo serialize($b);


Expected result:

Warning: __sleep is not defined on an overloaded object with __call()

Actual result:
--
Warning about unexpected return value to __sleep() and an empty string
output from serialize()





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


#25699 [Csd->Bgs]: for does not execute from within foreach

2003-09-29 Thread alan_k
 ID:   25699
 Updated by:   [EMAIL PROTECTED]
 Reported By:  richy at smilingsouls dot net
-Status:   Closed
+Status:   Bogus
 Bug Type: *Programming Data Structures
 Operating System: Windows XP Home
 PHP Version:  4.3.3
 New Comment:

Bogusing..


Previous Comments:


[2003-09-30 02:35:45] richy at smilingsouls dot net

I figured out that the condition wasn't ever being met.



[2003-09-30 02:18:23] richy at smilingsouls dot net

Description:

I have tried several variations of trying to use a for loop from within
a foreach.  In no case did the for loop execute.

I have no idea if this is simply not allowed, or a bug.  But it has
frustrated me enough to report it!

This works neither on my home dev. server (Xitami, Windows XP, PHP
4.3.3 R4) or on my remote ISP which sports some flavor of Unix.  See
server config at http://www.smilingsouls.net/phpinfo.php



Reproduce code:
---
function foo()
{
$foo[1] = 'test1';
$foo[2] = 'test2';  

foreach($foo as $key => $value)
{

for($d = 0; $d == 10; $d++) {echo $d;}

}

}

function foo2()
{
$foo[1] = 'test1';
$foo[2] = 'test2';  

foreach($foo as $key => $value)
{

loop_it();

}

}

function loop_it()
{
for($d = 0; $d == 10; $d++) {echo $d;}  
}

$foo[1] = 'test1';
$foo[2] = 'test2';

foreach($foo as $key => $value)
{

loop_it();

}

Expected result:

each should output:
012345678910
012345678910



Actual result:
--
blank, nothing!





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


#25831 [Opn->Ver]: overload/__call breaks method Pass by reference

2003-10-10 Thread alan_k
 ID:   25831
 Updated by:   [EMAIL PROTECTED]
-Summary:  Pass by reference doesn't work with subclasses of
   DB_DataObject
 Reported By:  viking at dslnorthwest dot net
-Status:   Open
+Status:   Verified
-Bug Type: PEAR related
+Bug Type: Scripting Engine problem
-Operating System: Mac OS X 10.2.8
+Operating System: all
-PHP Version:  4.3.3
+PHP Version:  4.3.3/4.3.4RC1
 New Comment:

simple script to reproduce:

pass_by_reference($message);
print "$message\n";



$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";


?>


should print 
Pass by reference works
Pass by reference works

actually prints
Pass by reference works
Pass by reference does not work!


Previous Comments:


[2003-10-10 19:30:28] viking at dslnorthwest dot net

Description:

When extending the DB_DataObject class using PHP 4.3.3, 
pass-by-reference calls to class methods don't work. 
After removing the call to overload() at the bottom of 
DB_DataObject.php, references work as expected. The 
following comments at the bottom of DB_DataObject 
allude to this:

// technially 4.3.2RC1 was broken!!
// looks like 4.3.3 may have problems too 
if ((phpversion() != '4.3.2-RC1') && (version_compare( 
phpversion(), "4.3.1") > 0)) {
   overload('DB_DataObject');
   $GLOBALS['_DB_DATAOBJECT']['OVERLOADED'] = true; 
}

Reproduce code:
---
require_once("DB/DataObject.php");

class no_problem
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

class problem extends DB_DataObject
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

$good = &new no_problem();
$bad = &new problem();

$message = "Pass by reference does not work!";
$good->pass_by_reference($message);
print "$message\n";

$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";

Expected result:

Pass by reference works 
Pass by reference works 

Actual result:
--
Pass by reference works 
Pass by reference does not work! 





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


#25879 [Bgs]: SORT_ASC when passed into a function can NOT be passed as a string

2003-10-16 Thread alan_k
 ID:   25879
 Updated by:   [EMAIL PROTECTED]
 Reported By:  it at oh-barcelona dot com
 Status:   Bogus
 Bug Type: Variables related
 Operating System: Windows
 PHP Version:  4.3.2
 New Comment:

hint..
http://www.php.net/manual/en/function.constant.php


Previous Comments:


[2003-10-15 11:22:47] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SORT_ASC, SORT_DESC, etc. are constants, not strings, so just treat
them as if they were numeric values:

$sortFlag = SORT_ASC; 
$new_array = array_column_sort($someArray,'column',$sortFlag)





[2003-10-15 08:25:18] it at oh-barcelona dot com

Description:

Hello,
   I've found a perplexing bug with sorting flags.  When you create a
function to create (for example) an dynamic array_multisort() and one
of the arguements which is passed is a SORT_ASC (or any other flag)
which is used to create the array_multisort() it MUST be passed without
quotes and not as a string.

In the example below you will see that if you gettype() of the $arg the
SORT_DESC returns an integer not a string when passed without quotes
and a string with.  

If the SORT flag is passed as a string the array_multisort acts as if
it were null.

This stops me from setting the SORT flag via if statement. 

I have written a work around but this problem should be addressed
because if you settype() a string it becomes "0".

The function call is:
 $ new_array = array_column_sort($someArray,'column',SORT_DESC)

The function does not work if you use:
$sortFlag = "SORT_ASC"; 
 $ new_array = array_column_sort($someArray,'column',$sortFlag )



Reproduce code:
---
function array_column_sort(){ 
  $args = func_get_args();
  $array = array_shift($args);
  // make a temporary copy of array for which will fix the 
  // keys to be strings, so that array_multisort() doesn't
  // destroy them
  $array_mod = array();
  foreach ($array as $key => $value)
$array_mod['_' . $key] = $value;
  
  $i = 0;
  $multi_sort_line = "return array_multisort( ";
  foreach ($args as $arg)  {
  $i++;
  if ( is_string($arg) ){
  foreach ($array_mod as $row_key => $row){
  $sort_array[$i][] = $row[$arg];
  }
  }else{
  $sort_array[$i] = $arg;
  }
  $multi_sort_line .= "\$sort_array[" . $i . "], ";
  }
  $multi_sort_line .= "\$array_mod );"; 
  eval($multi_sort_line);
  // now copy $array_mod back into $array, stripping off the "_"
  // that we added earlier.
  $array = array();
  foreach ($array_mod as $key => $value)
$array[ substr($key, 1) ] = $value;

  return $array;
}

Expected result:

The array should be sorted by column and SORT flag.

Actual result:
--
The array_multisort only excepts the SORT flag without quotes and not
as a string.





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


#25906 [Csd->Bgs]: Sessions and Framesets

2003-10-20 Thread alan_k
 ID:   25906
 Updated by:   [EMAIL PROTECTED]
 Reported By:  thxmike at hotpop dot com
-Status:   Closed
+Status:   Bogus
 Bug Type: Session related
 Operating System: Windows 2000 Professional
 PHP Version:  4.3.3
 New Comment:

not a bug (-> bogus)


Previous Comments:


[2003-10-20 22:32:06] thxmike at hotpop dot com

I have figured out the problem. Definately User Error. Sorry for all
the trouble. Thanks again for all your help



[2003-10-20 22:25:31] thxmike at hotpop dot com

I have posted it on a friends site. 
Here is the URL
http://www.anthong.com/MRivera/index.php



[2003-10-20 15:46:32] thxmike at hotpop dot com

OK, I do not show the same errors that you are seeing. I have made the
changes that you specified but I am still getting the same problem. The
$_SESSION Array is not staying populated if I go from the HOME link to
another link on the screen. I also noticed that you are using Apache. I
am using IIS. Not sure if this makes a difference Since I am not seeing
the errors that you are. It may also be a problem with my PHP.ini file.

I can send an updated version of the site and the ini file to so you
can see what I am seeing. Also you stated that the session_start() has
to be the first line. This concerns me especially if I am using
objects. It clearly states on your web site that if I am using objects
the class definitions have to be defined before session start. 
Any assistance you can provide is appreciated. Please let me know where
to send the updated site information. Thank you.



[2003-10-20 03:37:22] [EMAIL PROTECTED]

Your script is broken:

Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at /www/htdocs/test2/main.php:3) in
/www/htdocs/test2/main.php on line 10

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /www/htdocs/test2/main.php:3) in
/www/htdocs/test2/main.php on line 10
Array ( [temporary] => temporary ) 

'session_start();' has to be FIRST line and no output is allowed before
it. (unless you have output_compression enabled)



[2003-10-19 22:31:22] thxmike at hotpop dot com

I sent the support specialist a zip file with the web pages that has
the problem.



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/25906

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


#25943 [Opn->Bgs]: String comparison with "if"

2003-10-21 Thread alan_k
 ID:   25943
 Updated by:   [EMAIL PROTECTED]
 Reported By:  wolfgang dot wuensch at ww-informatik dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: Windows
 PHP Version:  4.3.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

php -r '
$a = "0205100104040203001";
$b = "0205100104040203002";
var_dump($a == $b);'
== true

php -r '
$a = "0205100104040203001";
$b = "0205100104040203002";
var_dump($a === $b);'
== false.

php will cast strings to numbers and compare them.. - depending on your
system. the number may be too big to store in an double.. 
- use bcmath or === or strcmp...



Previous Comments:


[2003-10-22 01:07:24] wolfgang dot wuensch at ww-informatik dot de

Description:

I compare two strings, who are different from each other.

The if-Statement gives me a "true".

I want a "false".

Reproduce code:
---
$val1="020510010404020301";
$val2="020510010404020302";

if( $val1 == $val2  )
{
echo $val1;
echo "";
echo $val2;
echo "";
echo "is not good";
}
else {
echo "yeah";
}

Expected result:

go into the "else"

Actual result:
--
go into the "if"



Note:
var_dump() used with $var1 and $var2 gives me string(18)

strcmp() works fine.





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


#25831 [Ver]: overload/__call breaks method Pass by reference

2003-10-24 Thread alan_k
 ID:   25831
 Updated by:   [EMAIL PROTECTED]
 Reported By:  viking at dslnorthwest dot net
 Status:   Verified
 Bug Type: Scripting Engine problem
 Operating System: all
 PHP Version:  4.3.4RC2-dev
 New Comment:

This appears to fix it.. 



? diff.txt
Index: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  24 Oct 2003 07:50:15 -
@@ -526,7 +526,7 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   if (zend_get_parameters_array(ht, ZEND_NUM_ARGS(), (zval **)args) ==
FAILURE) {
? diff.txt
Index: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  24 Oct 2003 07:50:15 -
@@ -526,7 +526,7 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   if (zend_get_parameters_array(ht, ZEND_NUM_ARGS(), (zval **)args) ==
FAILURE) {
efree(args);
php_error(E_WARNING, "unable to obtain arguments");
return;



efree(args);
php_error(E_WARNING, "unable to obtain arguments");
return;






Previous Comments:


[2003-10-10 22:12:29] [EMAIL PROTECTED]

simple script to reproduce:

pass_by_reference($message);
print "$message\n";



$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";


?>


should print 
Pass by reference works
Pass by reference works

actually prints
Pass by reference works
Pass by reference does not work!



[2003-10-10 19:30:28] viking at dslnorthwest dot net

Description:

When extending the DB_DataObject class using PHP 4.3.3, 
pass-by-reference calls to class methods don't work. 
After removing the call to overload() at the bottom of 
DB_DataObject.php, references work as expected. The 
following comments at the bottom of DB_DataObject 
allude to this:

// technially 4.3.2RC1 was broken!!
// looks like 4.3.3 may have problems too 
if ((phpversion() != '4.3.2-RC1') && (version_compare( 
phpversion(), "4.3.1") > 0)) {
   overload('DB_DataObject');
   $GLOBALS['_DB_DATAOBJECT']['OVERLOADED'] = true; 
}

Reproduce code:
---
require_once("DB/DataObject.php");

class no_problem
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

class problem extends DB_DataObject
{
function pass_by_reference(&$ref)
{
$ref = "Pass by reference works";
}
}

$good = &new no_problem();
$bad = &new problem();

$message = "Pass by reference does not work!";
$good->pass_by_reference($message);
print "$message\n";

$message = "Pass by reference does not work!";
$bad->pass_by_reference($message);
print "$message\n";

Expected result:

Pass by reference works 
Pass by reference works 

Actual result:
--
Pass by reference works 
Pass by reference does not work! 





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


#25831 [Ver]: overload/__call breaks method Pass by reference

2003-10-24 Thread alan_k
 ID:   25831
 Updated by:   [EMAIL PROTECTED]
 Reported By:  viking at dslnorthwest dot net
 Status:   Verified
 Bug Type: Scripting Engine problem
 Operating System: all
 PHP Version:  4.3.4RC2-dev
 New Comment:

OK this seems to be working without segfaults..

Index: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  25 Oct 2003 04:08:34 -
@@ -507,7 +507,7 @@
 static void overload_call_method(INTERNAL_FUNCTION_PARAMETERS,
zend_property_reference *property_reference)
 {
zval ***args;
-   zval *retval = NULL;
+   
int call_result;
zend_bool use_call_handler = 1;
zval *object = property_reference->object;
@@ -526,13 +526,15 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
-   efree(args);
-   php_error(E_WARNING, "unable to obtain arguments");
-   return;
-   }
 
if (use_call_handler) {
+   zval *retval = NULL;
+   
+   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
zval **handler_args[3];
zval *arg_array;
zval result, *result_ptr = &result;
@@ -588,23 +590,29 @@
}
zval_ptr_dtor(&retval);
} else {
+   zval retval;
+   if (zend_get_parameters_array(ht, ZEND_NUM_ARGS(), (zval **)args) ==
FAILURE) {
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
+
ZVAL_STRINGL(&call_handler, Z_STRVAL(method->element),
Z_STRLEN(method->element), 0);
-   call_result = call_user_function_ex(NULL,
+   call_result = call_user_function(NULL,
   
 &object,
   
 &call_handler,
-  
 &retval,
-  
 ZEND_NUM_ARGS(), args,
-  
 0, NULL TSRMLS_CC);
+  
 return_value,
+  
 ZEND_NUM_ARGS(),(zval **)args  TSRMLS_CC);
 
-   if (call_result == FAILURE || !retval) {
+   if (call_result == FAILURE || !&return_value) {
efree(args);
php_error(E_WARNING, "unable to call %s::%s() method",
Z_OBJCE_P(object)->name, Z_STRVAL(method->element));
return;
}
 
-   *return_value = *retval;
+
zIndex: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  25 Oct 2003 04:08:34 -
@@ -507,7 +507,7 @@
 static void overload_call_method(INTERNAL_FUNCTION_PARAMETERS,
zend_property_reference *property_reference)
 {
zval ***args;
-   zval *retval = NULL;
+   
int call_result;
zend_bool use_call_handler = 1;
zval *object = property_reference->object;
@@ -526,13 +526,15 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
-   efree(args);
-   php_error(E_WARNING, "unable to obtain arguments");
-   return;
-   }
 
if (use_call_handler) {
+   zval *retval = NULL;
+   
+   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
zval **handler_args[3];
zval *arg_array;
zval result, *result_ptr = &result;
@@ -588,23 +590,29 @@
}
zval_ptr_dtor(&retval);
} else {
+   zval retval;
+   if (zend_get_p

#25984 [Opn->Bgs]: Security Alert!

2003-10-24 Thread alan_k
 ID:   25984
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ali_momenh at yahoo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: CGI related
 Operating System: windows 2000 server
 PHP Version:  4.3.3
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

please ask for suport on the mailing lists


Previous Comments:


[2003-10-25 02:34:21] ali_momenh at yahoo dot com

Description:

ERROR :

Security Alert! 

The PHP CGI cannot be accessed directly. 
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual
page for CGI security.

For more information about changing this behaviour or re-enabling this
webserver, consult the installation file that came with this
distribution, or visit the manual page.


I Edited my php.ini and set the cgi.force_redirect to 0

Please Help me!!!
Thankx alot.
Ali


Reproduce code:
---
Security Alert! 

The PHP CGI cannot be accessed directly. 
This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means that a page will only be served up if the REDIRECT_STATUS CGI
variable is set, e.g. via an Apache Action directive.

For more information as to why this behaviour exists, see the manual
page for CGI security.

For more information about changing this behaviour or re-enabling this
webserver, consult the installation file that came with this
distribution, or visit the manual page.







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


#25831 [Ver]: overload/__call breaks method Pass by reference

2003-10-26 Thread alan_k
 ID:   25831
 Updated by:   [EMAIL PROTECTED]
 Reported By:  viking at dslnorthwest dot net
 Status:   Verified
 Bug Type: Scripting Engine problem
 Operating System: all
 PHP Version:  4.3.4RC2-dev
 New Comment:

Ignore the last patch - doesnt help..


Previous Comments:


[2003-10-25 00:09:31] [EMAIL PROTECTED]

OK this seems to be working without segfaults..

Index: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  25 Oct 2003 04:08:34 -
@@ -507,7 +507,7 @@
 static void overload_call_method(INTERNAL_FUNCTION_PARAMETERS,
zend_property_reference *property_reference)
 {
zval ***args;
-   zval *retval = NULL;
+   
int call_result;
zend_bool use_call_handler = 1;
zval *object = property_reference->object;
@@ -526,13 +526,15 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
-   efree(args);
-   php_error(E_WARNING, "unable to obtain arguments");
-   return;
-   }
 
if (use_call_handler) {
+   zval *retval = NULL;
+   
+   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
zval **handler_args[3];
zval *arg_array;
zval result, *result_ptr = &result;
@@ -588,23 +590,29 @@
}
zval_ptr_dtor(&retval);
} else {
+   zval retval;
+   if (zend_get_parameters_array(ht, ZEND_NUM_ARGS(), (zval **)args) ==
FAILURE) {
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
+
ZVAL_STRINGL(&call_handler, Z_STRVAL(method->element),
Z_STRLEN(method->element), 0);
-   call_result = call_user_function_ex(NULL,
+   call_result = call_user_function(NULL,
   
 &object,
   
 &call_handler,
-  
 &retval,
-  
 ZEND_NUM_ARGS(), args,
-  
 0, NULL TSRMLS_CC);
+  
 return_value,
+  
 ZEND_NUM_ARGS(),(zval **)args  TSRMLS_CC);
 
-   if (call_result == FAILURE || !retval) {
+   if (call_result == FAILURE || !&return_value) {
efree(args);
php_error(E_WARNING, "unable to call %s::%s() method",
Z_OBJCE_P(object)->name, Z_STRVAL(method->element));
return;
}
 
-   *return_value = *retval;
+
zIndex: overload.c
===
RCS file: /repository/php-src/ext/overload/Attic/overload.c,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 overload.c
--- overload.c  15 Apr 2003 04:14:21 -  1.20.2.3
+++ overload.c  25 Oct 2003 04:08:34 -
@@ -507,7 +507,7 @@
 static void overload_call_method(INTERNAL_FUNCTION_PARAMETERS,
zend_property_reference *property_reference)
 {
zval ***args;
-   zval *retval = NULL;
+   
int call_result;
zend_bool use_call_handler = 1;
zval *object = property_reference->object;
@@ -526,13 +526,15 @@
 
args = (zval ***)emalloc(ZEND_NUM_ARGS() * sizeof(zval **));
 
-   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
-   efree(args);
-   php_error(E_WARNING, "unable to obtain arguments");
-   return;
-   }
 
if (use_call_handler) {
+   zval *retval = NULL;
+   
+   if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE)
{
+   efree(args);
+   php_error(E_WARNING, "unable to obtain arguments");
+   return;
+   }
zval **handler_args[3];
zval *arg_array;
zval result, *resu

#25999 [Opn->Bgs]: I can convert the following code from asp to php

2003-10-27 Thread alan_k
 ID:   25999
 Updated by:   [EMAIL PROTECTED]
 Reported By:  yunlan at mail dot eestart dot com
-Status:   Open
+Status:   Bogus
 Bug Type: COM related
 Operating System: Microsoft window server 2003
 PHP Version:  4.3.4RC2
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

I suspect you want to call methods of the com object.
eg.
$com->FETCHNEXT();

likes like a great example of dumb syntax in ASP :)




Previous Comments:


[2003-10-27 04:51:36] yunlan at mail dot eestart dot com

Description:

ASP code:

<%
Set RS = Server.CreateObject("visualphd.data")
RS.HOSTNAME="APP22"
RS.TAGS.ADD "TIC1101.PV"
RS.SAMPLEFREQUENCY = 60
RS.SAMPLEMETHOD="SNAPSHOT"
RS.STARTTIME="NOW"
RS.ENDTIME="NOW"
RS.FETCH
response.write(rs.tags("TIC1101.PV").VALUE)
response.write("")
response.write(rs.tags("TIC1101.PV").timestamp)
response.write("")
response.write(rs.tags("TIC1101.PV").CONFIDENCE)
%>

Reproduce code:
---
I had Converted to php code:
HOSTNAME="APP22";
$obj->TAGS->ADD("TIC1101.PV");
$obj->SAMPLEFREQUENCY = 60;
$obj->SAMPLEMETHOD="SNAPSHOT";
$obj->STARTTIME="NOW";
$obj->ENDTIME="NOW";
$obj->MoveFirst;
$obj->FETCH;
print_r($obj->TAGS["TIC1101.PV"]->VALUE);
print_r("");
print_r($obj->TAGS["TIC1101.PV"]->timestamp);
print_r("");
print_r($obj->TAGS["TIC1101.PV"]->CONFIDENCE);
$obj=null;
?>
I don't know it is right that from "RS.TAGS.ADD \"TIC1101.PV\"" to
"$obj->TAGS->ADD("TIC1101.PV");"?

Expected result:

Expected result is so such:

10.0
2003-10-27 17:40:50
100%

Actual result:
--
Actual result:

0
0
0

I hope you to help me.

[EMAIL PROTECTED]





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


#26017 [Opn->Bgs]: Warning: fsockopen(): Bug

2003-10-28 Thread alan_k
 ID:   26017
 Updated by:   [EMAIL PROTECTED]
 Reported By:  hill at bluecarrots dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  4.3.3
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

.


Previous Comments:


[2003-10-28 04:40:49] hill at bluecarrots dot com

Description:

I get the warning at the top of the page. Several refreshes of the
browser rectifies.

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Name or service not known in /home/.sites/.blahphp on line 14

Warning: fsockopen(): unable to connect to blah.com:80 in
/home/.sites/blah.php on line 14
Resource temporarily unavailable (11)


Reproduce code:
---
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Name or service not known in /home/.sites/.blahphp on line 14

Warning: fsockopen(): unable to connect to blah.com:80 in
/home/.sites/blah.php on line 14
Resource temporarily unavailable (11)


Expected result:

I expect the page to connect securely to a secure server and send some
secure details.

I get the warning at the top of the page. Several refreshes of the
browser rectifies. I have to use this PHP code, which has been provided
by the Payment provider, to get to a server that takes online payments,
some information is first sent securely in order to reach the payment
page on the Payment providers server. 

Actual result:
--
The simple page takes time to load and when it does the fsockopen
warning is present.





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


#26016 [Opn->Fbk]: Warning: fsockopen(): Bug

2003-10-28 Thread alan_k
 ID:   26016
 Updated by:   [EMAIL PROTECTED]
 Reported By:  hill at bluecarrots dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  4.3.3
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


please provide a sample script to illustrate the problem


Previous Comments:


[2003-10-28 04:40:30] hill at bluecarrots dot com

Description:

I get the warning at the top of the page. Several refreshes of the
browser rectifies.

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Name or service not known in /home/.sites/.blahphp on line 14

Warning: fsockopen(): unable to connect to blah.com:80 in
/home/.sites/blah.php on line 14
Resource temporarily unavailable (11)


Reproduce code:
---
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed:
Name or service not known in /home/.sites/.blahphp on line 14

Warning: fsockopen(): unable to connect to blah.com:80 in
/home/.sites/blah.php on line 14
Resource temporarily unavailable (11)


Expected result:

I expect the page to connect securely to a secure server and send some
secure details.

I get the warning at the top of the page. Several refreshes of the
browser rectifies. I have to use this PHP code, which has been provided
by the Payment provider, to get to a server that takes online payments,
some information is first sent securely in order to reach the payment
page on the Payment providers server. 

Actual result:
--
The simle page takes time to load and when it does the fsockopen
warning is present.





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


#26025 [Opn->Fbk]: segfault when glob() is called with GLOB_BRACE and there are no matches

2003-10-28 Thread alan_k
 ID:   26025
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ryan at wonko dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: FreeBSD 4.7-RELEASE
 PHP Version:  4.3.4RC2
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

.


Previous Comments:


[2003-10-29 01:41:55] ryan at wonko dot com

Description:

When you call glob() with the GLOB_BRACE flag set, PHP segfaults if
there are no files or directories matching the pattern.

I'm running Apache 2.0.47 and PHP was built with the following
configure line:

'./configure' '--enable-versioning' '--enable-memory-limit'
'--with-layout=GNU' '--with-zlib-dir=/usr' '--disable-all'
'--with-regex=php' '--disable-cli' '--with-bz2=/usr' '--enable-ctype'
'--with-dom=/usr/local' '--enable-exif' '--enable-ftp' '--with-gd'
'--enable-gd-native-ttf' '--enable-gd-jis-conv'
'--with-freetype-dir=/usr/local' '--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr/local' '--with-xpm-dir=/usr/local'
'--with-gettext=/usr/local' '--with-mysql=/usr/local'
'--with-openssl-dir=/usr/local' '--with-openssl=/usr/local'
'--enable-overload' '--with-pcre-regex=yes' '--enable-posix'
'--with-pspell=/usr/local' '--enable-session' '--enable-sockets'
'--enable-tokenizer' '--with-expat-dir=/usr/local' '--enable-xml'
'--with-zip=/usr/local' '--with-zlib=yes'
'--with-apxs2=/usr/local/sbin/apxs' '--with-imap=/usr/local'
'--with-imap-ssl=/usr/local' '--prefix=/usr/local'
'i386-portbld-freebsd4.7'

Reproduce code:
---


Expected result:

glob() should return FALSE, indicating that there were no files or
directories matching the pattern.

Actual result:
--
PHP exits on signal 11 (segmentation fault), as illustrated by these
entries in my Apache error log:

[Tue Oct 28 22:38:02 2003] [notice] child pid 68645 exit signal
Segmentation fault (11)
[Tue Oct 28 22:38:03 2003] [notice] child pid 68670 exit signal
Segmentation fault (11)
[Tue Oct 28 22:38:12 2003] [notice] child pid 68800 exit signal
Segmentation fault (11)






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


#26054 [Opn->Bgs]: using unreferenced variables does not produce errors

2003-10-31 Thread alan_k
 ID:   26054
 Updated by:   [EMAIL PROTECTED]
 Reported By:  sascha dot wildgrube at steganos dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *Programming Data Structures
 Operating System: all
 PHP Version:  4.3.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

try error_reporting(E_ALL);




Previous Comments:


[2003-10-31 07:37:12] sascha dot wildgrube at steganos dot com

An even better solution would be the need to initialize variables like
that "var $nValue;". This way even typos in  in lvalues would not do
any harm.

We once observed how much percent of the time was consumed by this bug.
We found out that 30% of the time when working on php code could be
saved if php had strict variable usage.



[2003-10-31 07:26:30] sascha dot wildgrube at steganos dot com

Description:

Any variable identifier can be used in a statement - even if it hasn't
been referenced before - without producing an error.

Most of the time when debuggong php code is spent for searching typos
in variable names.

I consider it a bug that php does not produce and display error if it
encounters an unreferenced variable in a statement.

A solution could be a "strict" statement. That tells php to throw
errors in that case to stay backward compatible.

An even better solution would be the need to 

Reproduce code:
---
$nValue1 = 10;
$nValue2 = 20;
print($nVale1 + $nValue2);

Expected result:

Expected:

30

No, it is:

20

Why, because of the typo in line 3. What I want to happen in that case
is this:

Parse error: parse error in /somefile.php4 on line 3: unreferenced
object "$nVale1"

Actual result:
--
20





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


#26174 [Opn->Bgs]: Global vs. class vs. variable scope w/ include

2003-11-08 Thread alan_k
 ID:   26174
 Updated by:   [EMAIL PROTECTED]
 Reported By:  myle34 at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Variables related
 Operating System: Windows XP Home
 PHP Version:  5.0.0b2 (beta2)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

when you include a file within a function/method , the global code is
in the function/method scope.

therefore $foo is in the function scope... (not global)..

functions/classes/methods you define in there however are defined
globaly..


Previous Comments:


[2003-11-08 02:30:56] myle34 at hotmail dot com

Description:

This is related to Bug #26173 (http://bugs.php.net/bug.php?id=26173)
but the reproduce code was wrong.

I am using Windows XP Home and Apache 2.0.47 with PHP beta 2.

This bug is related to function/class/global scopes.

Note that if you merge foo.php and bar.php (foo.php and right after
that bar.php) (ie. without the include_once), this will work as
expected!

I haven't tested this with include but I suspect it would have the same
problem.

Reproduce code:
---
// foo.php


// bar.php
<();
?>

Expected result:

bar

Actual result:
--
No output





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


#26327 [Opn->Bgs]:  appears in Mysql DB

2003-11-19 Thread alan_k
 ID:   26327
 Updated by:   [EMAIL PROTECTED]
 Reported By:  mjsnetzko at worldbizhosting dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MySQL related
 Operating System: Red Hat
 PHP Version:  4.3.2
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

please contact one of the mailing lists.


Previous Comments:


[2003-11-19 21:04:25] mjsnetzko at worldbizhosting dot com

Description:

When using PHP to parse a comma delimited text file, and using each
comma delimited field as an array element, then entering those elements
into a Mysql DB, the very first line of the text file enters  into
the DB.  I have tried changing the character sets, etc.. nothing works.
 Please help.






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


#27554 [Opn->Bgs]: GTK installation failed

2004-03-10 Thread alan_k
 ID:   27554
 Updated by:   [EMAIL PROTECTED]
 Reported By:  timon at digitalforce dot ch
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Suse Linux 9.0
 PHP Version:  Irrelevant
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

hint: try installing php-devel packages.






Previous Comments:


[2004-03-10 18:17:30] timon at digitalforce dot ch

Description:

Hello my dearest



i am trying to install PHP-GTK (Version 0.5 and/or 1.0)

on my machine (SUSE-Linux 9.0)



in both cases when i call the #./buildconf shellscript i get the
following error.



make: phpize: Kommando nicht gefunden

make: *** [buildmk.stamp] Fehler 127



the above is in german an will mean 



make: phpize: command not found

make: *** [buildmk.stamp] error 127



so whats the problem?






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


#27561 [Opn->Bgs]: header("Location:.....");

2004-03-10 Thread alan_k
 ID:   27561
 Updated by:   [EMAIL PROTECTED]
 Reported By:  ignatius at act28 dot com
-Status:   Open
+Status:   Bogus
 Bug Type: *General Issues
 Operating System: WinXP
 PHP Version:  4.3.4
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Blame microsoft! - they have disabled this by default in the latest
update to IE.


Previous Comments:


[2004-03-11 00:27:32] ignatius at act28 dot com

Description:

Why can't I do this:



header("Location: http://user:[EMAIL PROTECTED]");



NS7 will redirect happily, but displays the user:pass in clear in the
address bar and changes all the in-page links to match the address bar
url.



IE will not play the game at all.

Reproduce code:
---
header("Location: http://user:[EMAIL PROTECTED]");





Expected result:

Browser redirects to http://myserver.com and authentication is passed
across to the basic auth relam.

Actual result:
--
As described above





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


#27744 [Opn->Bgs]: 141.23 - 141.00 = 0.22999999999999 ?

2004-03-28 Thread alan_k
 ID:   27744
 Updated by:   [EMAIL PROTECTED]
 Reported By:  t dot steve at ariadne-quatra dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: Windows 2000 Server SP4
 PHP Version:  5.0.0RC1
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.
 
Thank you for your interest in PHP.

.


Previous Comments:


[2004-03-29 01:05:32] t dot steve at ariadne-quatra dot com

Description:

Subtraction does not work as expected.



Windows 2000 Server

SP4

IIS5

PHP5RC1

Reproduce code:
---
$result=141.23-141.00;

echo $result;



(or 

$result=141.23-141;

echo $result;

 - same result)

Expected result:

0.23

Actual result:
--
0.22





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


#27744 [Bgs]: 141.23 - 141.00 = 0.22999999999999 ?

2004-03-30 Thread alan_k
 ID:   27744
 Updated by:   [EMAIL PROTECTED]
 Reported By:  t dot steve at ariadne-quatra dot com
 Status:   Bogus
 Bug Type: Math related
 Operating System: *
 PHP Version:  *
 New Comment:

create table a ( b float,c float );

Query OK, 0 rows affected (0.11 sec)

 

mysql> insert into a (b,c) values (141.23,141);

Query OK, 1 row affected (0.07 sec)

 

mysql> select b-c from a;

+--+

| b-c  |

+--+

| 0.22999572753906 |

+--+

1 row in set (0.00 sec)






Previous Comments:


[2004-03-30 13:45:03] [EMAIL PROTECTED]

That is the whole point of the answer. Floating point values are not
accurate and are not nice. And we do not do a bunch of work just to
make them look better in certain circumstances.



[2004-03-30 12:07:45] garbo_doe at hotmail dot com

IMHO I think this is a bug. Of course there are problems with
floatingpoint values in binary form, especially when rounded many
times. But in an operation like  it
shouldn't return "0.00" but "0.01". 

I did a quick test in Delphi: showmessage(floattostr(750 - 749.99));
returns "0.01, not "0.00".



I had to solve it in PHP but multiplying with 100, then subtract and
then divide the result by 100 again. 

It's not pretty :-D

(0.00999[infinite 9's] IS exactly the same as 0.01, but it should
remember the "infinite" with a bit or something, so (1/3)*3 = 1 and not
0.9)



(this is similar as bug #8164)



[2004-03-29 01:06:46] [EMAIL PROTECTED]

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.
 
Thank you for your interest in PHP.

.



[2004-03-29 01:05:32] t dot steve at ariadne-quatra dot com

Description:

Subtraction does not work as expected.



Windows 2000 Server

SP4

IIS5

PHP5RC1

Reproduce code:
---
$result=141.23-141.00;

echo $result;



(or 

$result=141.23-141;

echo $result;

 - same result)

Expected result:

0.23

Actual result:
--
0.22





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


#27790 [Opn->Bgs]: PHP chmod's totaly wrong

2004-03-30 Thread alan_k
 ID:   27790
 Updated by:   [EMAIL PROTECTED]
 Reported By:  postmaster at rrnet dot se
-Status:   Open
+Status:   Bogus
 Bug Type: Filesystem function related
 Operating System: Slackware 9.1
 PHP Version:  4.3.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

the mode is octel: eg. 0644 - not a string '644'


Previous Comments:


[2004-03-31 01:31:59] postmaster at rrnet dot se

Sorry, forgot to say that it gets everything from an uploadscript, and
then sets the right chmod to be able to delete the file later if
needed.



[2004-03-31 01:29:40] postmaster at rrnet dot se

Description:

PHP have some strange problem, to set file-permissions on my machine
(Slackware 9.1).



It sets them totaly wrong.



Software is PHP 4.3.4 on Apache 1.3.29.

Filesystem is ext3.

PHP is NOT in safe_mode.



Nothing more specific to report.

Reproduce code:
---
$file = "/home/dream/public_html/Upic/1/2.jpg";

chmod($file,'0644');



the same result happened with chmod($file,'644');

Expected result:

-rw-r--r--  1 nobody nobody 28739 Mar 31 08:30 2.jpg



Actual result:
--
--wr-T  1 nobody nobody 28739 Mar 31 08:30 2.jpg







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


#27884 [Opn->Fbk]: Segfault on overloading

2004-04-06 Thread alan_k
 ID:   27884
 Updated by:   [EMAIL PROTECTED]
 Reported By:  s dot dehaan at lobbes dot biz
-Status:   Open
+Status:   Feedback
 Bug Type: Class/Object related
 Operating System: Linux debian 2.2.20-idepci
 PHP Version:  4.3.6RC1
 New Comment:

Do you have the zend optimizer running?? = there are known problems
with this.






Previous Comments:


[2004-04-06 05:39:41] s dot dehaan at lobbes dot biz

The warning PHP prints is the following: 



Warning: String is not zero-terminated
(„̏*) (source:
/root/source/php4-STABLE-200404060830/Zend/zend_execute.c:341)



[2004-04-06 05:33:13] s dot dehaan at lobbes dot biz

Description:

Overloading a class called 'Configuration' tends to segfault on 4.3.5,
4.3.6RC1 & 4.3.6RC3 (snaps.php.net). 

Reproduce code:
---
class Configuration {



var $elem = Array();



function elements() {

return $this->elem;

}



function __get($prop_name, &$prop_value) {

if(isset($this->elem[$prop_name])) {

$prop_value = $this->elem[$prop_name];

return true;

} else {

return false;

}

}



function __set($prop_name, $prop_value) {

$this->elem[$prop_name] = $prop_value;

return true;

}

}

 

overload('Configuration');



$_CONFIG->db_type = 'mysql';

$_CONFIG->db_host = 'localhost';

$_CONFIG->db_user = 'user';

$_CONFIG->db_password = 'passwd';

$_CONFIG->db_name = 'database';



cause's segfault & abnormal termination of script.



Expected result:

No output, just storing the called fields in an array & being able to
fetch those values in the same manner as i've stored them using
overloading.

Actual result:
--
(gdb) bt

#0  0x401c09c7 in memcpy () from /lib/libc.so.6

#1  0x404886cf in _mem_block_check (ptr=0xbfffb21c, silent=0,

__zend_filename=0x4054bac0
"/root/source/php4-STABLE-200404060830/Zend/zend_execute.h",
__zend_lineno=44, __zend_orig_filename=0x0, __zend_orig_lineno=0)

at /root/source/php4-STABLE-200404060830/Zend/zend_alloc.c:675

#2  0x40488691 in _mem_block_check (ptr=0xbfffb21c, silent=1,

__zend_filename=0x4054bac0
"/root/source/php4-STABLE-200404060830/Zend/zend_execute.h",
__zend_lineno=44, __zend_orig_filename=0x0, __zend_orig_lineno=0)

at /root/source/php4-STABLE-200404060830/Zend/zend_alloc.c:667

#3  0x40487847 in _efree (ptr=0xbfffb21c,

__zend_filename=0x4054bac0
"/root/source/php4-STABLE-200404060830/Zend/zend_execute.h",
__zend_lineno=44, __zend_orig_filename=0x0, __zend_orig_lineno=0)

at /root/source/php4-STABLE-200404060830/Zend/zend_alloc.c:243

#4  0x40492522 in safe_free_zval_ptr (p=0xbfffb21c) at
zend_execute.h:44

#5  0x40490a96 in _zval_ptr_dtor (zval_ptr=0x828a4d0,

__zend_filename=0x4054c400
"/root/source/php4-STABLE-200404060830/Zend/zend_variables.c",
__zend_lineno=167)

at
/root/source/php4-STABLE-200404060830/Zend/zend_execute_API.c:292

#6  0x4049a811 in _zval_ptr_dtor_wrapper (zval_ptr=0x828a4d0)

at /root/source/php4-STABLE-200404060830/Zend/zend_variables.c:167

#7  0x404a281d in zend_hash_destroy (ht=0x82313e4)

at /root/source/php4-STABLE-200404060830/Zend/zend_hash.c:553

#8  0x40491b47 in call_user_function_ex (function_table=0xbfffab98,

object_pp=0xbfffac30, function_name=0xbfffab60,
retval_ptr_ptr=0xbfffab4c,

param_count=2, params=0xbfffab50, no_separation=0,
symbol_table=0x0)

at
/root/source/php4-STABLE-200404060830/Zend/zend_execute_API.c:569

#9  0x4038c92f in call_set_handler (object=0x8292214,
prop_name=0x8292680,

value=0xbfffb21c)

at
/root/source/php4-STABLE-200404060830/ext/overload/overload.c:307

#10 0x4038cfd6 in overload_set_property
(property_reference=0xbfffb1d4,

value=0xbfffb21c)

at
/root/source/php4-STABLE-200404060830/ext/overload/overload.c:468

#11 0x404acb11 in set_overloaded_property (T=0xbfffb1c8,
value=0xbfffb21c)

at /root/source/php4-STABLE-200404060830/Zend/zend_execute.c:977

#12 0x404b455b in zend_assign_to_variable (result=0x820f8f8,
op1=0x820f908,

op2=0x820f918, value=0xbfffb21c, type=2, Ts=0xbfffad4c)

at /root/source/php4-STABLE-200404060830/Zend/zend_execute.c:338

#13 0x404aecd2 in execute (op_array=0x8332fcc)

at /root/source/php4-STABLE-200404060830/Zend/zend_execute.c:1378

#14 0x404b2157 in execute (op_array=0x82928f4)

at /root/source/php4-STABLE-200404060830/Zend/zend_execute.c:2200

#15 0x4049c3f0 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)

at /root/source/php4-STABLE-200404060830/Zend/zend.c:889

#16 0x40460ec9 in php_execute_sc

#28253 [Opn->Fbk]: WEBSITES ONLY HALF

2004-05-02 Thread alan_k
 ID:   28253
 Updated by:   [EMAIL PROTECTED]
 Reported By:  info at jephp dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: UNIX OR W2K
 PHP Version:  4.3.4
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



Previous Comments:


[2004-05-02 16:06:14] info at jephp dot com

Description:

PHP/4.3.1 GOOD
PHP/4.3.4-PHP/4.3.6 VERY BAD

Reproduce code:
---
http://www.qyren.com:8001/com/hrkj/index.php3?file=2.php3&kdir=264&nowdir=264

  PHP°æ±¾£º php4.3.1 
  ½âÒëÒýÇæ: Apache/2.0.45 (Win32) PHP/4.3.1  
 IS GOOD


http://www.jephp.com/auto/com/hrkj/index.php3?file=2.php3&kdir=264&nowdir=264
 PHP°æ±¾£º php4.3.4 
 ½âÒëÒýÇæ: Apache/2.0.48 (Unix) DAV/2 PHP/4.3.4 

ID VERY BAD



Expected result:

php4ts.dll FILE IS BAD IN PHP/4.3.4PHP/4.3.6 UNIX OR W2K

Actual result:
--
PHP/4.3.4--PHP/4.3.6
HAVE BUGS





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


#28443 [Opn->Bgs]: Var is changed without a reason

2004-05-19 Thread alan_k
 ID:   28443
 Updated by:   [EMAIL PROTECTED]
 Reported By:  nitz at framingo dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Win2k
 PHP Version:  4.3.6
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

$this->$limit
$this->limit

you are using variable properties.. - effetcively setting $this->{''}

try running with error_reporting(E_ALL);


Previous Comments:


[2004-05-19 09:28:56] nitz at framingo dot de

Description:

Class constructor sets a var to a value that is only assigned to an
other var.


Reproduce code:
---
$timestamp=0;
$this->$limit=1; 
echo "1 val limit=".$this->$limit."";
if ($ts<0)
$this->$timestamp=time();
else
 $this->$timestamp=2;
echo "2 val limit=".$this->$limit."";
}
}
$cmp=new FG_Timestamp(0);
?>

Expected result:

1 val limit=1
2 val limit=1 

Actual result:
--
1 val limit=1
2 val limit=2





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


#29716 [Opn]: Critical - conditional class definitions are compiled and produce errors

2004-08-16 Thread alan_k
 ID:   29716
 Updated by:   [EMAIL PROTECTED]
 Reported By:  alan at akbkhome dot com
 Status:   Open
 Bug Type: Zend Engine 2 problem
 Operating System: all
 PHP Version:  5.0.1
 New Comment:

Relivant change
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?ws=0&r1=1.567&r2=1.567.2.1&ty=u

I suggest testing for > 1, rather than != 2 on call, as that's the only
one who's API changed in PHP4->5



Previous Comments:


[2004-08-17 06:01:38] alan at akbkhome dot com

Description:

something changed in 5.0.1 that breaks conditional class definitions.
hence breaking code that worked ok on php4 & php5.0.0

Reproduce code:
---


Expected result:

nothing


Actual result:
--
Content-type: text/html
X-Powered-By: PHP/5.0.1
 

Fatal error:  Method DB_DataObject_Overload::__call() must take
exactly 2 arguments in /usr/src/php/php-5.0.1/test1.php on line
16
a





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


#29736 [Bgs->Opn]: instanceof requires class to be loaded

2004-08-18 Thread alan_k
 ID:   29736
 Updated by:   [EMAIL PROTECTED]
 Reported By:  hans at velum dot net
-Status:   Bogus
+Status:   Open
 Bug Type: Feature/Change Request
 Operating System: *
 PHP Version:  5.0.1
 New Comment:

The example was buggy, but the bug exists :)

php5 -r 'class Foo{} $f = unserialize("O:3:\"Foo\":0:{}");
var_dump(!($foo instanceof Bar));'

Bar could be a huge class, I dont want to load it just to check $f
wasnt a instance of it?


Previous Comments:


[2004-08-19 02:40:32] hans at velum dot net

Well, no ... the problem that I am describing has nothing to do with
unserialize().  That was just an example that Sean posted that
illustrates how is_a() and instanceof differ.  I apologize if that
wasn't clear.

You did reproduce the bug in your first example.

Simple reproduction:



Will result in E_FATAL (no such class).  That's the problem.  is_a()
has no such limitations, but is now deprecated.  This change
suggestion/request is asking for a way to check whether a variable is
an instance of a particular class/superclass/interface *without loading
that class/interface*.

Hope that makes it clearer.

-Hans



[2004-08-19 01:28:46] [EMAIL PROTECTED]

Can't reproduce:

[EMAIL PROTECTED] /usr/src/PHP_5_0 $ php -r 'function __autoload($name) {
var_dump($name); } $x = NULL; var_dump($x instanceof test);'
make: `sapi/cli/php' is up to date.
string(4) "test"

Fatal error: Class 'test' not found in Command line code on line 1
[EMAIL PROTECTED] /usr/src/PHP_5_0 $ php -r 'function __autoload($name) {
var_dump($name); eval("class $name {}");} $x = NULL; var_dump($x
instanceof test);'
make: `sapi/cli/php' is up to date.
string(4) "test"
bool(false)

So the problem lies in unserialize() -> other bug



[2004-08-18 16:31:23] hans at velum dot net

Description:

[pasted from messages on internals@ list]

I like the new $obj instanceof ClassName way of checking class /
interface types,  but this method does have one major drawback
compared to the old is_a() approach:

  The class must be loaded in order to perform an instanceof check!

There are many situations where you do not want to have to load every
class to see whether a returned object is a class of that type.  In
particular for driver classes, the current model requires loading
*every* possible driver in order to check to see which type of class
was returned.

is_a() works great, but has been deprecated and is now generating
E_STRICT errors.


Reproduce code:
---
[conributed by Sean Coates on internals@ list]



 and 



Expected result:

$foo is_a Foo? yes
$foo instanceof Foo? yes

 and 

$foo is_a Foo? no
$foo instanceof Foo? no



Actual result:
--
$foo is_a Foo? yes
$foo instanceof Foo? yes

 and 

$foo is_a Foo? no

Fatal error: Class 'Foo' not found in 
/home/sean/phpdoc/scripts/tmp/is_a.php on line 8





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


#29716 [Bgs->WFx]: alan_k

2004-08-19 Thread alan_k
 ID:   29716
 Updated by:   [EMAIL PROTECTED]
-Summary:  Critical - conditional class definitions are compiled
   and produce errors
 Reported By:  alan at akbkhome dot com
-Status:   Bogus
+Status:   Wont fix
 Bug Type: Zend Engine 2 problem
 Operating System: *
 PHP Version:  5.*
 Assigned To:  helly
 New Comment:

changing status to reflect situation.  

Probably the best workaround to offer overload PHP4/PHP5 compatiblity
is to use eval to create a base class eg.

eval('
class PHP4_Overload {
function __call($method,$args,&$return) {
return $this->_call($method,$args,$return);;
}
}
');



Previous Comments:


[2004-08-17 09:25:48] [EMAIL PROTECTED]

Btw. ext/overload:
This extension is EXPERIMENTAL. The behaviour of this extension --
including the names of its functions and anything else documented about
this extension -- may change without notice in a future release of PHP.
Use this extension at your own risk



[2004-08-17 09:18:32] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

We no longer support ext/overload (and ext/aggregation). In PHP 5
__autoload was reimplemented as a new different feature even though it
is in some manner meant to be able to replace the old behavior. But it
is meant to do it etter and offer more. Hence unfortunatley those two
are different things and yes we broke BC.



[2004-08-17 08:15:28] [EMAIL PROTECTED]

Marcus breaks it, marcus should fix it :)
Also, can you please add a test case for this?

thanks



[2004-08-17 06:21:19] [EMAIL PROTECTED]

Relivant change
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?ws=0&r1=1.567&r2=1.567.2.1&ty=u

I suggest testing for > 1, rather than != 2 on call, as that's the only
one who's API changed in PHP4->5




[2004-08-17 06:01:38] alan at akbkhome dot com

Description:

something changed in 5.0.1 that breaks conditional class definitions.
hence breaking code that worked ok on php4 & php5.0.0

Reproduce code:
---


Expected result:

nothing


Actual result:
--
Content-type: text/html
X-Powered-By: PHP/5.0.1
 

Fatal error:  Method DB_DataObject_Overload::__call() must take
exactly 2 arguments in /usr/src/php/php-5.0.1/test1.php on line
16
a





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


#29716 [WFx]: __call with wrong no. of arguments prevents simple BC wrappers.

2004-08-19 Thread alan_k
 ID:   29716
 Updated by:   [EMAIL PROTECTED]
-Summary:  alan_k
 Reported By:  alan at akbkhome dot com
 Status:   Wont fix
 Bug Type: Zend Engine 2 problem
 Operating System: *
 PHP Version:  5.*
 New Comment:

changing title (oops)


Previous Comments:


[2004-08-20 05:50:22] [EMAIL PROTECTED]

changing status to reflect situation.  

Probably the best workaround to offer overload PHP4/PHP5 compatiblity
is to use eval to create a base class eg.

eval('
class PHP4_Overload {
function __call($method,$args,&$return) {
return $this->_call($method,$args,$return);;
}
}
');




[2004-08-17 09:25:48] [EMAIL PROTECTED]

Btw. ext/overload:
This extension is EXPERIMENTAL. The behaviour of this extension --
including the names of its functions and anything else documented about
this extension -- may change without notice in a future release of PHP.
Use this extension at your own risk



[2004-08-17 09:18:32] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

We no longer support ext/overload (and ext/aggregation). In PHP 5
__autoload was reimplemented as a new different feature even though it
is in some manner meant to be able to replace the old behavior. But it
is meant to do it etter and offer more. Hence unfortunatley those two
are different things and yes we broke BC.



[2004-08-17 08:15:28] [EMAIL PROTECTED]

Marcus breaks it, marcus should fix it :)
Also, can you please add a test case for this?

thanks



[2004-08-17 06:21:19] [EMAIL PROTECTED]

Relivant change
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?ws=0&r1=1.567&r2=1.567.2.1&ty=u

I suggest testing for > 1, rather than != 2 on call, as that's the only
one who's API changed in PHP4->5




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/29716

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


#30170 [Opn->Bgs]: method to return function name

2004-09-20 Thread alan_k
 ID:   30170
 Updated by:   [EMAIL PROTECTED]
 Reported By:  anagai at verizon dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: windows 2000
 PHP Version:  4.3.7
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

try __FUNCTION__


Previous Comments:


[2004-09-20 18:52:12] anagai at verizon dot net

Description:

This is a feature request. It would be nice if there was a method that
returned the current function name. This would be good for error
logging. I currently have to manually enter the function name in each
function that has error handling. sometime i copy functions and they
will have the wrong function name for error handling. a method that
returned the current function name would be nice.






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


  1   2   >