#40654 [NEW]: reference causes foreach to fail proper iteration

2007-02-26 Thread saeven at saeven dot net
From: saeven at saeven dot net
Operating system: 
PHP version:  5.2.1
PHP Bug Type: Scripting Engine problem
Bug description:  reference causes foreach to fail proper iteration

Description:

Using a reference to build an array, later causes foreach to fail when
reusing the reference variable name.

The bug is solved by adding unset( $element); before block B, but this
shouldn't be necessary.

Reproduce code:
---
// Block A - Build the Array
$a = array( 2 = array( value = a ), 
4 = array( value = b ),
6 = array( value = c ) );

$b = array( orange, blue, green );

foreach( $a as $id = $element ){
$extra = array();

foreach( $b as $color )
array_push( $extra, $color );

$element += array( 'extra' = $extra );
}

// Block B - Iterate through
foreach( $a as $element )
echo $element[value].' ';


Expected result:

a b c

Actual result:
--
a b b

-- 
Edit bug report at http://bugs.php.net/?id=40654edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40654r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40654r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40654r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40654r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=40654r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=40654r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=40654r=needscript
Try newer version:http://bugs.php.net/fix.php?id=40654r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=40654r=support
Expected behavior:http://bugs.php.net/fix.php?id=40654r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=40654r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=40654r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40654r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40654r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40654r=dst
IIS Stability:http://bugs.php.net/fix.php?id=40654r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=40654r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40654r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=40654r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=40654r=mysqlcfg


#38782 [NEW]: Object confusion related to arrays

2006-09-11 Thread saeven at saeven dot net
From: saeven at saeven dot net
Operating system: CentOS/Windows/Slackware
PHP version:  5.1.6
PHP Bug Type: Scripting Engine problem
Bug description:  Object confusion related to arrays

Description:

When specifying a parameter object type in a method signature, if the
object was stored in an array prior to being passed, the method signature
revokes the object type even though var_dump reports it to be correct!



Reproduce code:
---
[file: obj.php]

class Obj1{
  //.. object methods/params herein
}

---
[file: main.php]

function foo( Obj1 $x ){}

$a = array();
$o = new Obj1();
$a[0] = $o;

foo( $a[0] );

Expected result:

shouldn't see any errors

Actual result:
--
Fatal error: Argument 1 passed to foo() must be an object of class Obj1

-- 
Edit bug report at http://bugs.php.net/?id=38782edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38782r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38782r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38782r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38782r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=38782r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=38782r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=38782r=needscript
Try newer version:http://bugs.php.net/fix.php?id=38782r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=38782r=support
Expected behavior:http://bugs.php.net/fix.php?id=38782r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=38782r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=38782r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38782r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38782r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38782r=dst
IIS Stability:http://bugs.php.net/fix.php?id=38782r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=38782r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38782r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=38782r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=38782r=mysqlcfg


#38782 [Opn-Csd]: Object confusion related to arrays

2006-09-11 Thread saeven at saeven dot net
 ID:   38782
 User updated by:  saeven at saeven dot net
 Reported By:  saeven at saeven dot net
-Status:   Open
+Status:   Closed
 Bug Type: Scripting Engine problem
 Operating System: CentOS/Windows/Slackware
 PHP Version:  5.1.6
 New Comment:

Issue corrected.


Previous Comments:


[2006-09-11 18:52:30] saeven at saeven dot net

Description:

When specifying a parameter object type in a method signature, if the
object was stored in an array prior to being passed, the method
signature revokes the object type even though var_dump reports it to be
correct!



Reproduce code:
---
[file: obj.php]

class Obj1{
  //.. object methods/params herein
}

---
[file: main.php]

function foo( Obj1 $x ){}

$a = array();
$o = new Obj1();
$a[0] = $o;

foo( $a[0] );

Expected result:

shouldn't see any errors

Actual result:
--
Fatal error: Argument 1 passed to foo() must be an object of class Obj1





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


#36489 [NEW]: Mimeheaders not properly encoded/decoded

2006-02-22 Thread saeven at saeven dot net
From: saeven at saeven dot net
Operating system: Linux
PHP version:  5.1.2
PHP Bug Type: mbstring related
Bug description:  Mimeheaders not properly encoded/decoded

Description:

mbstring is improperly encoding/decoding mimeheaders.

Reproduce code:
---
$encode = mb_encode_mimeheader( test_#1090;#1077;#1089;#1090;,
utf-8, 'Q' );
echo mb_decode_mimeheader( $encode );

Expected result:

test_#1090;#1077;#1089;#1090;

Actual result:
--
test_

-- 
Edit bug report at http://bugs.php.net/?id=36489edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36489r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36489r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36489r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36489r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=36489r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=36489r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=36489r=needscript
Try newer version:http://bugs.php.net/fix.php?id=36489r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=36489r=support
Expected behavior:http://bugs.php.net/fix.php?id=36489r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=36489r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=36489r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36489r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36489r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36489r=dst
IIS Stability:http://bugs.php.net/fix.php?id=36489r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=36489r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36489r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=36489r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=36489r=mysqlcfg


#36489 [Opn]: Mimeheaders not properly encoded/decoded

2006-02-22 Thread saeven at saeven dot net
 ID:   36489
 User updated by:  saeven at saeven dot net
 Reported By:  saeven at saeven dot net
 Status:   Open
 Bug Type: mbstring related
 Operating System: Linux
 PHP Version:  5.1.2
 New Comment:

Your system htmlencoded the utf8 content. Let me try again:

Code:
---
$encode = mb_encode_mimeheader( test_#1090;#1077;#1089;#1090;,
utf-8, 'Q' );
echo mb_decode_mimeheader( $encode );


Expected Result:
--
test_#1090;#1077;#1089;#1090;;


Actual Result:

test_


Previous Comments:


[2006-02-22 21:00:24] saeven at saeven dot net

Description:

mbstring is improperly encoding/decoding mimeheaders.

Reproduce code:
---
$encode = mb_encode_mimeheader( test_#1090;#1077;#1089;#1090;,
utf-8, 'Q' );
echo mb_decode_mimeheader( $encode );

Expected result:

test_#1090;#1077;#1089;#1090;

Actual result:
--
test_





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


#36489 [Opn]: Mimeheaders not properly encoded/decoded

2006-02-22 Thread saeven at saeven dot net
 ID:   36489
 User updated by:  saeven at saeven dot net
 Reported By:  saeven at saeven dot net
 Status:   Open
 Bug Type: mbstring related
 Operating System: Linux
 PHP Version:  5.1.2
 New Comment:

..you'll have to imagine that the htmlencoded entities are utf8
characters.


Previous Comments:


[2006-02-22 21:03:43] saeven at saeven dot net

Your system htmlencoded the utf8 content. Let me try again:

Code:
---
$encode = mb_encode_mimeheader( test_#1090;#1077;#1089;#1090;,
utf-8, 'Q' );
echo mb_decode_mimeheader( $encode );


Expected Result:
--
test_#1090;#1077;#1089;#1090;;


Actual Result:

test_



[2006-02-22 21:00:24] saeven at saeven dot net

Description:

mbstring is improperly encoding/decoding mimeheaders.

Reproduce code:
---
$encode = mb_encode_mimeheader( test_#1090;#1077;#1089;#1090;,
utf-8, 'Q' );
echo mb_decode_mimeheader( $encode );

Expected result:

test_#1090;#1077;#1089;#1090;

Actual result:
--
test_





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


#32971 [Fbk-Opn]: SIGPIPE Broken Pipe, occurs on one of two machines

2005-05-08 Thread saeven at saeven dot net
 ID:   32971
 User updated by:  saeven at saeven dot net
 Reported By:  saeven at saeven dot net
-Status:   Feedback
+Status:   Open
 Bug Type: Zend Engine 2 problem
 Operating System: Fedora Core 2
 PHP Version:  5.0.4
 New Comment:

Hi,

  Having compiled with --enable-debug, being forced then to use the
unencoded version, the problem no longer occurs.  The bug then safely
can be assumed to be with Zend Optimizer?  Where should I direct a Zend
Optimizer bug report?

Thanks!
Alex


Previous Comments:


[2005-05-07 03:29:56] [EMAIL PROTECTED]

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.

your stack trace is not useful for two reasons:
- you need to build a debug build of PHP (which means running without
the zend optimizer)
- gdb will catch signals like SIGPIPE that are otherwise handled by the
program being debugged.  You can either tell gdb to cont when you see
that message, or create a .gdbinit file that has handle SIGPIPE
nostop in it.



[2005-05-06 22:16:54] saeven at saeven dot net

Description:

Inclusion of a custom user session object at a particular point causes
segmentation faults.  Occurs in both Zend optimized and un-optimized
code.

Works on several machines, but fails on a distinct few as well.  Apache
as well as PHP have been recompiled.

Help interpreting the stack trace would be appreciated.

Actual result:
--
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread -1208590208 (LWP 15537)]
0x0060d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0 0x0060d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x006d9eac in writev () from /lib/tls/libc.so.6
#2 0x08073fb9 in ssl_io_hook_writev ()
#3 0x080ac402 in ap_hook_call_func ()
#4 0x080abbea in ap_hook_call ()
#5 0x080884c4 in writev_it_all ()
#6 0x08088859 in large_write ()
#7 0x0808891c in ap_bwrite ()
#8 0x0809beee in ap_rwrite ()
#9 0x0030b9a3 in ?? () from /usr/local/apache/libexec/libphp5.so
#10 0x002c6b8b in ?? () from /usr/local/apache/libexec/libphp5.so
#11 0x002c6bf9 in ?? () from /usr/local/apache/libexec/libphp5.so
#12 0x002c5dfe in ?? () from /usr/local/apache/libexec/libphp5.so
#13 0x002e8639 in ?? () from /usr/local/apache/libexec/libphp5.so
#14 0x002e85df in ?? () from /usr/local/apache/libexec/libphp5.so
#15 0x002e8130 in ?? () from /usr/local/apache/libexec/libphp5.so
#16 0x00b13849 in get_module () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#17 0x00b79738 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#18 0x003956f4 in ?? () from /usr/local/apache/libexec/libphp5.so
#19 0x00b134a0 in get_module () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#20 0x00b7c6e0 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#21 0xbfe1caf8 in ?? ()
#22 0xbfe1cb38 in ?? ()
#23 0x00b79738 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#24 0x00b7c6e0 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#25 0xbfe1caf8 in ?? ()
#26 0x in ?? ()





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


#32971 [NEW]: SIGPIPE Broken Pipe, occurs on one of two machines

2005-05-06 Thread saeven at saeven dot net
From: saeven at saeven dot net
Operating system: Fedora Core 2
PHP version:  5.0.4
PHP Bug Type: Zend Engine 2 problem
Bug description:  SIGPIPE Broken Pipe, occurs on one of two machines

Description:

Inclusion of a custom user session object at a particular point causes
segmentation faults.  Occurs in both Zend optimized and un-optimized
code.

Works on several machines, but fails on a distinct few as well.  Apache as
well as PHP have been recompiled.

Help interpreting the stack trace would be appreciated.

Actual result:
--
Program received signal SIGPIPE, Broken pipe.
[Switching to Thread -1208590208 (LWP 15537)]
0x0060d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0 0x0060d7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x006d9eac in writev () from /lib/tls/libc.so.6
#2 0x08073fb9 in ssl_io_hook_writev ()
#3 0x080ac402 in ap_hook_call_func ()
#4 0x080abbea in ap_hook_call ()
#5 0x080884c4 in writev_it_all ()
#6 0x08088859 in large_write ()
#7 0x0808891c in ap_bwrite ()
#8 0x0809beee in ap_rwrite ()
#9 0x0030b9a3 in ?? () from /usr/local/apache/libexec/libphp5.so
#10 0x002c6b8b in ?? () from /usr/local/apache/libexec/libphp5.so
#11 0x002c6bf9 in ?? () from /usr/local/apache/libexec/libphp5.so
#12 0x002c5dfe in ?? () from /usr/local/apache/libexec/libphp5.so
#13 0x002e8639 in ?? () from /usr/local/apache/libexec/libphp5.so
#14 0x002e85df in ?? () from /usr/local/apache/libexec/libphp5.so
#15 0x002e8130 in ?? () from /usr/local/apache/libexec/libphp5.so
#16 0x00b13849 in get_module () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#17 0x00b79738 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#18 0x003956f4 in ?? () from /usr/local/apache/libexec/libphp5.so
#19 0x00b134a0 in get_module () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#20 0x00b7c6e0 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#21 0xbfe1caf8 in ?? ()
#22 0xbfe1cb38 in ?? ()
#23 0x00b79738 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#24 0x00b7c6e0 in ?? () from
/usr/local/Zend/lib/Optimizer-2.5.7/php-5.0.x/ZendOptimizer.so
#25 0xbfe1caf8 in ?? ()
#26 0x in ?? ()

-- 
Edit bug report at http://bugs.php.net/?id=32971edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32971r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32971r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32971r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=32971r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=32971r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=32971r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=32971r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=32971r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32971r=support
Expected behavior:   http://bugs.php.net/fix.php?id=32971r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=32971r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=32971r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=32971r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32971r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=32971r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=32971r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32971r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32971r=float
No Zend Extensions:  http://bugs.php.net/fix.php?id=32971r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32971r=mysqlcfg