Bug #48547 [Com]: DirectoryIterator Slash issue with getPathname Windows with Apache

2012-12-22 Thread vitoandre dot doria at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=48547&edit=1

 ID: 48547
 Comment by: vitoandre dot doria at gmail dot com
 Reported by:BinaryKitten at jkrswebsolutions dot co dot uk
 Summary:DirectoryIterator Slash issue with getPathname
 Windows with Apache
 Status: Not a bug
 Type:   Bug
 Package:SPL related
 Operating System:   win32 only - WinXP SP3
 PHP Version:5.2.9
 Assigned To:garretts
 Block user comment: N
 Private report: N

 New Comment:

I really disagree with garretts "Not a bug" statement.

First of all if you had read the PHP Target Version you would know there is no 
FilesystemIterator in 5.2 Branch.

Secondly if the directoryIterator uses "the default platform slash" like you 
indicate then PHP or better the DirectoryIterator should:

A: treat the Path "c:/some/path/" as unresolvable as you state it doesnt use 
this slashes!
B: more likely convert all forward slashes on the target version to the 
"default 
platform slash" (you are doing this anyway for the 
last slash as you indicate which is clearly inconsistent)

Also have a note on: http://msdn.microsoft.com/en-
us/library/windows/desktop/aa365247(v=vs.85).aspx
It clearly states that the API would swap "ALL" forward slashes with backward 
slashes and not only the last one! Like 
directoryIterator does


BinaryKitten stated realpath would fix this issue which doesnt always apply as 
it might return null for the current path while 
DirectoryIterator returns a path (see: 
http://php.net/manual/en/function.realpath.php) which means this problem relys 
unresolved!

The "Not a bug" philosophy here on bugs.php.net in the last years is getting 
ill 
imho!


Previous Comments:

[2009-09-06 14:57:00] BinaryKitten at jkrswebsolutions dot co dot uk

FilesystemIterator is not available in the 5.2.9 codebase, 5.3+ so 
FilesystemIterator doesn't resolve the issue. What does is passing the 
$_SERVER['DOCUMENT_ROOT'] to realpath before passing the result to the 
DirectoryIterator;

".$dir->getPath()."";
foreach($dir as $file ) {
  $dirName = $file->getPathname();
  echo $dirName."";
}
?>

This "solves" the issue.


[2009-08-19 18:02:22] garre...@php.net

Use the FilesystemIterator class (a subclass of DirectorIterator) if you want 
to force the directory separator to the forward slash.

Directory iterator only supports the default platform slash.

http://us.php.net/manual/en/class.filesystemiterator.php

// will use forward slashes.
$dir = new FilesystemIterator( $path, 8192 );






[2009-06-14 19:22:59] webmaster at asylum-et dot cm

I have tested this on Windows XP SP3 with PHP 5.2.5 and have the same 
findings as BinaryKitten at jkrswebsolutions dot co dot uk


[2009-06-14 11:47:49] BinaryKitten at jkrswebsolutions dot co dot uk

Description:

When using the DirectoryIterator to go through files/folders on Windows under 
apache, the path has a mismatch of \ and /

Reproduce code:
---
".$dir->getPath()."";
foreach($dir as $file ) {
  $dirName = $file->getPathname();
  echo $dirName."";
}
?>

Expected result:

With the Document root as C:\HTDOCS Apache returns $_SERVER['DOCUMENT_ROOT'] as 
c:/HTDOCS

Expected Output
C:/HTDOCS/.
C:/HTDOCS/..
C:/HTDOCS/css
C:/HTDOCS/index.php
C:/HTDOCS/js
C:/HTDOCS/

Actual result:
--
C:/HTDOCS\.
C:/HTDOCS\..
C:/HTDOCS\css
C:/HTDOCS\index.php
C:/HTDOCS\js







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


[PHP-BUG] Bug #63833 [NEW]: udiff doesn't compare properly inside arrays

2012-12-22 Thread francois dot dambrine at isen-lille dot fr
From: francois dot dambrine at isen-lille dot fr
Operating system: Windows
PHP version:  5.5.0alpha2
Package:  Arrays related
Bug Type: Bug
Bug description:udiff doesn't compare properly inside arrays

Description:

This bug was introduced to me by a stackoverflow post 
http://stackoverflow.com/questions/13815287/union-two-associative-array-
php/13815578#13815578 I tested the behaviour with php 5.5 Alpha 2 and the
"bug" is 
still there.

As of the documentation, it is said that array_diff uses an "internal
function" to 
compare two elements.

As equality is the only thing that matters for array_diff I thought this
internal 
function was something that "==" behind.

But even if two arrays are equal (same members) array_diff does not take it
in 
account.

I mark it as a bug but it can only be a documentation problem.

Test script:
---
"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3",
'id_poste'=>4,
'id_part'=>14
)
);

$B = Array(
array(
'lable' =>"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1_X",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3_X",
'id_poste'=>4,
'id_part'=>14
)
);

var_dump(array_diff_assoc($B,$A));

Expected result:

Array(2){
[0]=>array(3){
["lable"] =>"label1_X",
["id_poste"]=>2,
["id_part"]=>12
},
[1]=>array(3){
["lable"] =>"label3_X",
["id_poste"]=>4,
["id_part"]=>14
}
}


Actual result:
--
array(0){
}

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63833&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63833&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63833&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63833&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63833&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63833&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63833&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63833&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63833&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63833&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63833&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63833&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63833&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63833&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63833&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63833&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63833&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63833&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63833&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63833&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63833&r=mysqlcfg



Bug #63833 [Opn->Nab]: udiff doesn't compare properly inside arrays

2012-12-22 Thread rasmus
Edit report at https://bugs.php.net/bug.php?id=63833&edit=1

 ID: 63833
 Updated by: ras...@php.net
 Reported by:francois dot dambrine at isen-lille dot fr
 Summary:udiff doesn't compare properly inside arrays
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:Arrays related
 Operating System:   Windows
 PHP Version:5.5.0alpha2
 Block user comment: N
 Private report: N

 New Comment:

The documentation clearly states, "This function only checks one dimension of a 
n-dimensional array. Of course you can check deeper dimensions by using 
array_diff($array1[0], $array2[0]);."

Your example is using 2-dimensional arrays.


Previous Comments:

[2012-12-22 12:38:38] francois dot dambrine at isen-lille dot fr

Description:

This bug was introduced to me by a stackoverflow post 
http://stackoverflow.com/questions/13815287/union-two-associative-array-
php/13815578#13815578 I tested the behaviour with php 5.5 Alpha 2 and the "bug" 
is 
still there.

As of the documentation, it is said that array_diff uses an "internal function" 
to 
compare two elements.

As equality is the only thing that matters for array_diff I thought this 
internal 
function was something that "==" behind.

But even if two arrays are equal (same members) array_diff does not take it in 
account.

I mark it as a bug but it can only be a documentation problem.

Test script:
---
"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3",
'id_poste'=>4,
'id_part'=>14
)
);

$B = Array(
array(
'lable' =>"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1_X",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3_X",
'id_poste'=>4,
'id_part'=>14
)
);

var_dump(array_diff_assoc($B,$A));

Expected result:

Array(2){
[0]=>array(3){
["lable"] =>"label1_X",
["id_poste"]=>2,
["id_part"]=>12
},
[1]=>array(3){
["lable"] =>"label3_X",
["id_poste"]=>4,
["id_part"]=>14
}
}


Actual result:
--
array(0){
}






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


Bug #63833 [Com]: udiff doesn't compare properly inside arrays

2012-12-22 Thread francois dot dambrine at isen-lille dot fr
Edit report at https://bugs.php.net/bug.php?id=63833&edit=1

 ID: 63833
 Comment by: francois dot dambrine at isen-lille dot fr
 Reported by:francois dot dambrine at isen-lille dot fr
 Summary:udiff doesn't compare properly inside arrays
 Status: Not a bug
 Type:   Bug
 Package:Arrays related
 Operating System:   Windows
 PHP Version:5.5.0alpha2
 Block user comment: N
 Private report: N

 New Comment:

I know it is multidimensional array. My problem is that if I want to compute 
the 
difference between those thwo multidimentional arrays. 
For now I can use array_udiff to get only the subarray with "lable"=>"Label1X" 
and 
Label2X, I have to use array_udiff even if when I test $A[0] == $B[0] I get 
true.
So I was wondering if it was a bug or just a lack of precision in the 
documentation.
If it is a documentation problem, I can go to edit.php.net


Previous Comments:

[2012-12-22 13:01:54] ras...@php.net

The documentation clearly states, "This function only checks one dimension of a 
n-dimensional array. Of course you can check deeper dimensions by using 
array_diff($array1[0], $array2[0]);."

Your example is using 2-dimensional arrays.


[2012-12-22 12:38:38] francois dot dambrine at isen-lille dot fr

Description:

This bug was introduced to me by a stackoverflow post 
http://stackoverflow.com/questions/13815287/union-two-associative-array-
php/13815578#13815578 I tested the behaviour with php 5.5 Alpha 2 and the "bug" 
is 
still there.

As of the documentation, it is said that array_diff uses an "internal function" 
to 
compare two elements.

As equality is the only thing that matters for array_diff I thought this 
internal 
function was something that "==" behind.

But even if two arrays are equal (same members) array_diff does not take it in 
account.

I mark it as a bug but it can only be a documentation problem.

Test script:
---
"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3",
'id_poste'=>4,
'id_part'=>14
)
);

$B = Array(
array(
'lable' =>"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1_X",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3_X",
'id_poste'=>4,
'id_part'=>14
)
);

var_dump(array_diff_assoc($B,$A));

Expected result:

Array(2){
[0]=>array(3){
["lable"] =>"label1_X",
["id_poste"]=>2,
["id_part"]=>12
},
[1]=>array(3){
["lable"] =>"label3_X",
["id_poste"]=>4,
["id_part"]=>14
}
}


Actual result:
--
array(0){
}






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


Bug #63833 [Nab]: diff doesn't compare properly inside arrays

2012-12-22 Thread francois dot dambrine at isen-lille dot fr
Edit report at https://bugs.php.net/bug.php?id=63833&edit=1

 ID: 63833
 User updated by:francois dot dambrine at isen-lille dot fr
 Reported by:francois dot dambrine at isen-lille dot fr
-Summary:udiff doesn't compare properly inside arrays
+Summary:diff doesn't compare properly inside arrays
 Status: Not a bug
 Type:   Bug
 Package:Arrays related
 Operating System:   Windows
 PHP Version:5.5.0alpha2
 Block user comment: N
 Private report: N

 New Comment:

problem in the title


Previous Comments:

[2012-12-22 13:30:18] francois dot dambrine at isen-lille dot fr

I know it is multidimensional array. My problem is that if I want to compute 
the 
difference between those thwo multidimentional arrays. 
For now I can use array_udiff to get only the subarray with "lable"=>"Label1X" 
and 
Label2X, I have to use array_udiff even if when I test $A[0] == $B[0] I get 
true.
So I was wondering if it was a bug or just a lack of precision in the 
documentation.
If it is a documentation problem, I can go to edit.php.net


[2012-12-22 13:01:54] ras...@php.net

The documentation clearly states, "This function only checks one dimension of a 
n-dimensional array. Of course you can check deeper dimensions by using 
array_diff($array1[0], $array2[0]);."

Your example is using 2-dimensional arrays.


[2012-12-22 12:38:38] francois dot dambrine at isen-lille dot fr

Description:

This bug was introduced to me by a stackoverflow post 
http://stackoverflow.com/questions/13815287/union-two-associative-array-
php/13815578#13815578 I tested the behaviour with php 5.5 Alpha 2 and the "bug" 
is 
still there.

As of the documentation, it is said that array_diff uses an "internal function" 
to 
compare two elements.

As equality is the only thing that matters for array_diff I thought this 
internal 
function was something that "==" behind.

But even if two arrays are equal (same members) array_diff does not take it in 
account.

I mark it as a bug but it can only be a documentation problem.

Test script:
---
"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3",
'id_poste'=>4,
'id_part'=>14
)
);

$B = Array(
array(
'lable' =>"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1_X",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3_X",
'id_poste'=>4,
'id_part'=>14
)
);

var_dump(array_diff_assoc($B,$A));

Expected result:

Array(2){
[0]=>array(3){
["lable"] =>"label1_X",
["id_poste"]=>2,
["id_part"]=>12
},
[1]=>array(3){
["lable"] =>"label3_X",
["id_poste"]=>4,
["id_part"]=>14
}
}


Actual result:
--
array(0){
}






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


Bug #63833 [Nab]: diff doesn't compare properly inside arrays

2012-12-22 Thread rasmus
Edit report at https://bugs.php.net/bug.php?id=63833&edit=1

 ID: 63833
 Updated by: ras...@php.net
 Reported by:francois dot dambrine at isen-lille dot fr
 Summary:diff doesn't compare properly inside arrays
 Status: Not a bug
 Type:   Bug
 Package:Arrays related
 Operating System:   Windows
 PHP Version:5.5.0alpha2
 Block user comment: N
 Private report: N

 New Comment:

I still don't understand what you are asking about. array_diff being 1-
dimensional means it doesn't look inside nested arrays at all. If you have a 
nested array, it treats it as if it was "Array" because it casts all elements 
in 
that dimension to its scalar equivalent. For example, these two are identical 
as 
far as array_diff() is concerned:

$a = [ 1, 2, [3, 4] ];
$b = [ 1, 2, "Array" ];


Previous Comments:

[2012-12-22 13:31:32] francois dot dambrine at isen-lille dot fr

problem in the title


[2012-12-22 13:30:18] francois dot dambrine at isen-lille dot fr

I know it is multidimensional array. My problem is that if I want to compute 
the 
difference between those thwo multidimentional arrays. 
For now I can use array_udiff to get only the subarray with "lable"=>"Label1X" 
and 
Label2X, I have to use array_udiff even if when I test $A[0] == $B[0] I get 
true.
So I was wondering if it was a bug or just a lack of precision in the 
documentation.
If it is a documentation problem, I can go to edit.php.net


[2012-12-22 13:01:54] ras...@php.net

The documentation clearly states, "This function only checks one dimension of a 
n-dimensional array. Of course you can check deeper dimensions by using 
array_diff($array1[0], $array2[0]);."

Your example is using 2-dimensional arrays.


[2012-12-22 12:38:38] francois dot dambrine at isen-lille dot fr

Description:

This bug was introduced to me by a stackoverflow post 
http://stackoverflow.com/questions/13815287/union-two-associative-array-
php/13815578#13815578 I tested the behaviour with php 5.5 Alpha 2 and the "bug" 
is 
still there.

As of the documentation, it is said that array_diff uses an "internal function" 
to 
compare two elements.

As equality is the only thing that matters for array_diff I thought this 
internal 
function was something that "==" behind.

But even if two arrays are equal (same members) array_diff does not take it in 
account.

I mark it as a bug but it can only be a documentation problem.

Test script:
---
"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3",
'id_poste'=>4,
'id_part'=>14
)
);

$B = Array(
array(
'lable' =>"label0",
'id_poste'=>1,
'id_part'=>11
),
array(
'lable' =>"label1_X",
'id_poste'=>2,
'id_part'=>12
),
array(
'lable' =>"label2",
'id_poste'=>3,
'id_part'=>13
),
array(
'lable' =>"label3_X",
'id_poste'=>4,
'id_part'=>14
)
);

var_dump(array_diff_assoc($B,$A));

Expected result:

Array(2){
[0]=>array(3){
["lable"] =>"label1_X",
["id_poste"]=>2,
["id_part"]=>12
},
[1]=>array(3){
["lable"] =>"label3_X",
["id_poste"]=>4,
["id_part"]=>14
}
}


Actual result:
--
array(0){
}






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


[PHP-BUG] Req #63834 [NEW]: Add a function to detect a methods calling context

2012-12-22 Thread tolan333 at gmail dot com
From: tolan333 at gmail dot com
Operating system: Any
PHP version:  Irrelevant
Package:  Class/Object related
Bug Type: Feature/Change Request
Bug description:Add a function to detect a methods calling context

Description:

Currently it is hard to get to know the exact context from which a method
is called from. Sure, there is debug_backtrace and the Reflection API, but
these are no ideal nor complete and reliable solutions.

I suggest to introduce a new function: get_calling_context (similar to
get_calling_class).

A possible use-case is shown below

Possible return values could be:



Use case:
Currently I use virtual properties (via __get and __set) to validate and
manipulate properties data while still keeping the ability to iterate over
the entire object(implementing IteratorAggregate). This allows me also to
have different visibility states for accessors (which will hopefully be
supported in 5.5 without having to rely on custom implementations) but not
for the properties themself.

Simplified __set implementation:
{'set' . \ucfirst($name)}($value);
} else {
throw new WritePropertyFromWrongContextException("virtual
property $name can not be accessed from this context");
}
} elseif (\method_exists($this, 'set' . \ucfirst($name))) {
return $this->{'set' . \ucfirst($name)}($value);
} elseif ($this->objectConfiguration['accessMapAsProps'] == true &&
$this->offsetExists($name)) {
$this[$name] =
$this->createPropertyValidator($name)->validate($value,$this->getRuleSet()[$name])->getValidatedValue();
} else {
throw new WriteNonExistingPropertyException("Virtual property
\$$name does not exist in class " .
\get_class($this));
}
}
?>

There is no possibility to react on different scenarios as there can be
only one __set which is either public,protected or private. There is no
option to implement different behaviors for different visibility.

Another usecase is the usage of object callbacks in handlers like
session.set.save.handler

For example the write callback does not (per documentation) output data.
However in debug scenarios and in unit-tests it would be ideal to know if
the method was called from the core as a usual session handler or in a
different scenario in usercode.


Additionally this would go inline with already existing functions like
get_called_class, get_parent_class and partly get_class.



-- 
Edit bug report at https://bugs.php.net/bug.php?id=63834&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63834&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63834&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63834&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63834&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63834&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63834&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63834&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63834&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63834&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63834&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63834&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63834&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63834&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63834&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63834&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63834&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63834&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63834&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63834&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63834&r=mysqlcfg



[PHP-BUG] Bug #63835 [NEW]: two cookie in request ,get comma in first cookie name

2012-12-22 Thread tom916 at qq dot com
From: tom916 at qq dot com
Operating system: linux
PHP version:  5.3Git-2012-12-22 (Git)
Package:  *General Issues
Bug Type: Bug
Bug description:two cookie in request ,get comma in first cookie name

Description:

When the browser client send 2 Cookie: in header,the php get first cookie
name has a comma in the fist char。God know know the browser send 2 Cookie
in header ?


Array
(
[,_a] => 1
)

Test script:
---
--show_cookie.php--
\n";
} else {
$out = "GET /show_cookie.php HTTP/1.1\r\n";
$out .= "Host: localhost:50080\r\n";
$out .= "Cookie:\r\n";
$out .= "Cookie: a=1\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}


php send_cookie.php

-result---
HTTP/1.1 200 OK
Date: Sat, 22 Dec 2012 17:11:59 GMT
Server: Apache/2.2.17 (Unix) PHP/5.3.3
X-Powered-By: PHP/5.3.3
Content-Length: 25
Connection: close
Content-Type: text/html

Array
(
[,_a] => 1
)


Expected result:

Array
(
[a] => 1
)

Actual result:
--
Array
(
[,_a] => 1
)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63835&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63835&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63835&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63835&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63835&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63835&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63835&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63835&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63835&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63835&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63835&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63835&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63835&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63835&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63835&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63835&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63835&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63835&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63835&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63835&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63835&r=mysqlcfg



[PHP-BUG] Bug #63836 [NEW]: Don't work ob_gzhandler

2012-12-22 Thread if-post at ifinterface dot com
From: if-post at ifinterface dot com
Operating system: Windows XPx32 SP3
PHP version:  5.4.10
Package:  *Web Server problem
Bug Type: Bug
Bug description:Don't work ob_gzhandler

Description:

PHP 5.4.10
Windows XPx32 SP3
Apache/2.2.22 VC9

Don't work ob_gzhandler in ob_start('ob_gzhandler');
I don't receive header=Content-Encoding: gzip (realy don't zip)
when I specify header=Content-Length:

On Ubuntu 12.04x64 (Apache/2.2.22 PHP 5.4.9) - all ok!
On Windows XPx32 (Apache/2.2.22 VC9 PHP 5.3) - all ok!

Test script:
---


Expected result:

header=Content-Encoding: gzip

Actual result:
--
Nothing = no zip.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63836&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63836&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63836&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63836&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63836&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63836&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63836&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63836&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63836&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63836&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63836&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63836&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63836&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63836&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63836&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63836&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63836&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63836&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63836&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63836&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63836&r=mysqlcfg



[PHP-BUG] Req #63837 [NEW]: Privater abstract functions

2012-12-22 Thread larry at ldrutlege dot com
From: larry at ldrutlege dot com
Operating system: 
PHP version:  5.4.10
Package:  Class/Object related
Bug Type: Feature/Change Request
Bug description:Privater abstract functions

Description:

>From the page http://php.net/manual/en/migration51.oop.php


"Abstract private methods were supported between PHP 5.0.0 and PHP 5.0.4,
but were then disallowed on the grounds that the behaviours of private and
abstract are mutually exclusive."


This was true in PHP 5.3 and earlier since any method declared abstract
private could not be accessed outside the declaring class and so the
definition was without function.

In PHP 5.4 and later however, traits may have access to private methods of
a class and so an abstract private definition may have a purpose. For
instance, traits may have need of helper methods which may be needed only
by the trait's methods and nowhere else. In those cases, an abstract
private method may be the appropriate declaration to place in the trait to
ensure the helper method is defined in the using class.

Abstract private methods however remain useless except within traits, so
within traits is the only place they need to be permitted.

And as an aside, the word "behaviors" is misspelled on that page.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63837&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63837&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63837&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=63837&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=63837&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=63837&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63837&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=63837&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=63837&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=63837&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=63837&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63837&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63837&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=63837&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63837&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=63837&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=63837&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=63837&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63837&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63837&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63837&r=mysqlcfg



Req #63837 [Opn]: Privater abstract functions

2012-12-22 Thread larry at ldrutlege dot com
Edit report at https://bugs.php.net/bug.php?id=63837&edit=1

 ID: 63837
 User updated by:larry at ldrutlege dot com
 Reported by:larry at ldrutlege dot com
 Summary:Privater abstract functions
 Status: Open
 Type:   Feature/Change Request
 Package:Class/Object related
 PHP Version:5.4.10
 Block user comment: N
 Private report: N

 New Comment:

Actually not misspelled per se, but spelled according to British spelling 
whereas the English site seems to primarily use American spelling.


Previous Comments:

[2012-12-22 19:47:53] larry at ldrutlege dot com

Description:

>From the page http://php.net/manual/en/migration51.oop.php


"Abstract private methods were supported between PHP 5.0.0 and PHP 5.0.4, but 
were then disallowed on the grounds that the behaviours of private and abstract 
are mutually exclusive."


This was true in PHP 5.3 and earlier since any method declared abstract private 
could not be accessed outside the declaring class and so the definition was 
without function.

In PHP 5.4 and later however, traits may have access to private methods of a 
class and so an abstract private definition may have a purpose. For instance, 
traits may have need of helper methods which may be needed only by the trait's 
methods and nowhere else. In those cases, an abstract private method may be the 
appropriate declaration to place in the trait to ensure the helper method is 
defined in the using class.

Abstract private methods however remain useless except within traits, so within 
traits is the only place they need to be permitted.

And as an aside, the word "behaviors" is misspelled on that page.







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


Bug #63835 [Opn]: two cookie in request ,get comma in first cookie name

2012-12-22 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=63835&edit=1

 ID: 63835
 Updated by: larue...@php.net
 Reported by:tom916 at qq dot com
 Summary:two cookie in request ,get comma in first cookie
 name
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:5.3Git-2012-12-22 (Git)
 Block user comment: N
 Private report: N

 New Comment:

I don't think it's a php specific bug, php read the cookie via apache 
apr_table_get

 
apr_table_get return ", a=1" in your case.


Previous Comments:

[2012-12-22 17:21:20] tom916 at qq dot com

Description:

When the browser client send 2 Cookie: in header,the php get first cookie 
name has a comma in the fist char。God know know the browser send 2 Cookie in 
header ?


Array
(
[,_a] => 1
)

Test script:
---
--show_cookie.php--
\n";
} else {
$out = "GET /show_cookie.php HTTP/1.1\r\n";
$out .= "Host: localhost:50080\r\n";
$out .= "Cookie:\r\n";
$out .= "Cookie: a=1\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}


php send_cookie.php

-result---
HTTP/1.1 200 OK
Date: Sat, 22 Dec 2012 17:11:59 GMT
Server: Apache/2.2.17 (Unix) PHP/5.3.3
X-Powered-By: PHP/5.3.3
Content-Length: 25
Connection: close
Content-Type: text/html

Array
(
[,_a] => 1
)


Expected result:

Array
(
[a] => 1
)

Actual result:
--
Array
(
[,_a] => 1
)






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


Bug #63835 [Opn]: two cookie in request ,get comma in first cookie name

2012-12-22 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=63835&edit=1

 ID: 63835
 Updated by: larue...@php.net
 Reported by:tom916 at qq dot com
 Summary:two cookie in request ,get comma in first cookie
 name
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:5.3Git-2012-12-22 (Git)
 Block user comment: N
 Private report: N

 New Comment:

oh, ignore my previous comment, apache return a comma separated string if there 
is 
multi cookie headers


Previous Comments:

[2012-12-23 05:46:39] larue...@php.net

I don't think it's a php specific bug, php read the cookie via apache 
apr_table_get

 
apr_table_get return ", a=1" in your case.


[2012-12-22 17:21:20] tom916 at qq dot com

Description:

When the browser client send 2 Cookie: in header,the php get first cookie 
name has a comma in the fist char。God know know the browser send 2 Cookie in 
header ?


Array
(
[,_a] => 1
)

Test script:
---
--show_cookie.php--
\n";
} else {
$out = "GET /show_cookie.php HTTP/1.1\r\n";
$out .= "Host: localhost:50080\r\n";
$out .= "Cookie:\r\n";
$out .= "Cookie: a=1\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}


php send_cookie.php

-result---
HTTP/1.1 200 OK
Date: Sat, 22 Dec 2012 17:11:59 GMT
Server: Apache/2.2.17 (Unix) PHP/5.3.3
X-Powered-By: PHP/5.3.3
Content-Length: 25
Connection: close
Content-Type: text/html

Array
(
[,_a] => 1
)


Expected result:

Array
(
[a] => 1
)

Actual result:
--
Array
(
[,_a] => 1
)






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


Bug #63835 [PATCH]: two cookie in request ,get comma in first cookie name

2012-12-22 Thread larue...@php.net
Edit report at https://bugs.php.net/bug.php?id=63835&edit=1

 ID: 63835
 Patch added by: larue...@php.net
 Reported by:tom916 at qq dot com
 Summary:two cookie in request ,get comma in first cookie
 name
 Status: Open
 Type:   Bug
 Package:*General Issues
 Operating System:   linux
 PHP Version:5.3Git-2012-12-22 (Git)
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: bug63835.patch
Revision:   1356242654
URL:
https://bugs.php.net/patch-display.php?bug=63835&patch=bug63835.patch&revision=1356242654


Previous Comments:

[2012-12-23 05:48:53] larue...@php.net

oh, ignore my previous comment, apache return a comma separated string if there 
is 
multi cookie headers


[2012-12-23 05:46:39] larue...@php.net

I don't think it's a php specific bug, php read the cookie via apache 
apr_table_get

 
apr_table_get return ", a=1" in your case.


[2012-12-22 17:21:20] tom916 at qq dot com

Description:

When the browser client send 2 Cookie: in header,the php get first cookie 
name has a comma in the fist char。God know know the browser send 2 Cookie in 
header ?


Array
(
[,_a] => 1
)

Test script:
---
--show_cookie.php--
\n";
} else {
$out = "GET /show_cookie.php HTTP/1.1\r\n";
$out .= "Host: localhost:50080\r\n";
$out .= "Cookie:\r\n";
$out .= "Cookie: a=1\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}


php send_cookie.php

-result---
HTTP/1.1 200 OK
Date: Sat, 22 Dec 2012 17:11:59 GMT
Server: Apache/2.2.17 (Unix) PHP/5.3.3
X-Powered-By: PHP/5.3.3
Content-Length: 25
Connection: close
Content-Type: text/html

Array
(
[,_a] => 1
)


Expected result:

Array
(
[a] => 1
)

Actual result:
--
Array
(
[,_a] => 1
)






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


Bug #11059 [Com]: PHP does not register GET variables $HTTP_GET_VARS is empty. POST works OK.

2012-12-22 Thread skewl at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=11059&edit=1

 ID: 11059
 Comment by: skewl at gmail dot com
 Reported by:bub at seznam dot cz
 Summary:PHP does not register GET variables $HTTP_GET_VARS
 is empty. POST works OK.
 Status: Closed
 Type:   Bug
 Package:Variables related
 Operating System:   RedHat 5.1
 PHP Version:4.0.5
 Block user comment: N
 Private report: N

 New Comment:

reprimanded each other as narrow and cruel dictator, very open to all the 
students show that today we no[url=http://www.mbtukshop.co.uk/]MBT Shoes[/url]


Previous Comments:

[2003-10-31 05:37:34] kiryaka at mail dot ru

just turn on the register_globals directive in php.ini and restart apache.


[2001-05-28 07:41:09] bub at seznam dot cz

I've recompiled php and apache and it works. 

Thanks anyway


[2001-05-24 13:14:30] bub at seznam dot cz

It doesn't work either and $PHP_SELF is empty as well. I did not know that, 
because I didn't use it my scripts. 


[2001-05-24 12:48:57] cardi...@php.net

The system speed wouldn't impact behavior, no.

Your script refers to $data['n_id'] though, not $data['id'].  Let's remove any 
confusion and work with a very basic script:

Click here
Getvariable is: 

Try that one out.



[2001-05-24 03:22:17] bub at seznam dot cz

valiables_order is set to EGPCS. I tried EPCSG but it did not work either. 

$data["id"] was non empty.

The computer in question is i486 with 12 MB RAM. Could that be a 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

https://bugs.php.net/bug.php?id=11059


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


Req #10527 [Com]: Declare constant variables

2012-12-22 Thread skewl at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=10527&edit=1

 ID: 10527
 Comment by: skewl at gmail dot com
 Reported by:jnutzman at yahoo dot com
 Summary:Declare constant variables
 Status: Open
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   *
 PHP Version:*
 Block user comment: N
 Private report: N

 New Comment:

I don't know NaLinDa the TangJun speech organizers really going to give our 
students http://www.mbtukshop.co.uk/ how to cultivate the values


Previous Comments:

[2001-04-27 12:37:44] jnutzman at yahoo dot com

PHP 4 doesn't seem to have the capability to define variables of all types as 
being constants. An example of this could be:

$stuff = (const)array('1','2');
or
$stuff = const($stuff);

An error would be generated if the script later tried to:
$stuff = array('3','2');

This is *not* the same as CONSTANTS like TRUE and FALSE.

This would be extremely useful with sessions, so other programmers don't 
clobber important session variables that shouldn't change. 





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