#48804 [NEW]: Overriding results in declaration error

2009-07-05 Thread christian dot achatz at adventure-php-framework dot org
From: christian dot achatz at adventure-php-framework dot org
Operating system: CentOS 5.3 (final)
PHP version:  5.3.0
PHP Bug Type: Class/Object related
Bug description:  Overriding results in declaration error

Description:

As of PHP 5.3.0 my custom class (PageControllerInputFilter) is not
compiling any more. Reason for this is:

Declaration of PageControllerInputFilter::filter() should be compatible
with that of AbstractFilter::filter().

Rewriting the filter() function to signature
"filter($filterInstruction,$input = null)" would solve the problem, but
this is no implementation of the filter() method (e.g. interface behaviour)
on PageControllerInputFilter, but overriding. Hence, the name of the
variables must not be spellt equally. Even in JAVA, you can freely choose
your variable names when overriding a method from a super-class.

Tests were executed using PHP compiled from source on my centos machine
using

[r...@centos53 ~]# md5sum /root/php53-source/php-5.3.0.tar.bz2
846760cd655c98dfd86d6d97c3d964b0  /root/php53-source/php-5.3.0.tar.bz2
[r...@centos53 ~]# ./configure --with-apxs2=$(which apxs)
--prefix=/root/php53/ --with-zlib --without-pear
[r...@centos53 ~]# make
[r...@centos53 ~]# make install

Reproduce code:
---
abstract class AbstractFilter extends coreObject {

   function AbstractFilter(){
   }

   function filter($filterInstruction,$input = null){
  return $input;
   }

}

class PageControllerInputFilter extends AbstractFilter {

   function PageControllerInputFilter(){
   }

   function filter($instruction,$content){
  return $content;
   }

}

Definition of the class coreObject can be seen here:
http://adventurephpfra.svn.sourceforge.net/viewvc/adventurephpfra/branches/php5/1.10/core/pagecontroller/pagecontroller.php?revision=573&view=markup

Expected result:

No fatal, no declaration warning.

Actual result:
--
Declaration of PageControllerInputFilter::filter() should be compatible
with that of AbstractFilter::filter().
Fatal error: Class 'PageControllerInputFilter' not found in
/var/www/html/php53/apps/core/filter/PageControllerInputFilter.php on line
82.

Package to test this behaviour can be found here:
http://media.adventure-php-framework.org/php53/adventure-demopack-1.10-RC1-2009-07-05-1404-php5.tar.gz.
Just extract into document root and call via browser.

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



[PHP-BUG] Bug #54317 [NEW]: Regexp crashes Apache/PHP

2011-03-19 Thread christian dot achatz at adventure-php-framework dot org
From: 
Operating system: Windows
PHP version:  5.3.6
Package:  Regexps related
Bug Type: Bug
Bug description:Regexp crashes Apache/PHP

Description:

---

>From manual page: http://www.php.net/function.preg-replace#Description

---

Calling the script below apache crashes on windows installations. After
removing almost any of the lines inside $notworking apache will NOT crash,
no matter which line was removed in most cases.





Here is the system list that causes a crash or not:



Windows 7 SP1 (64bit) | XAMPP | Apache/2.2.17 (Win32) | PHP 5.3.5 | <<<
CRASH!

Windows XP (32+64bit) | XAMPP | Apache 2.2.17 | PHP 5.3.5 | <<< CRASH!

WinXP 32Bit / Apache 2.2.17 / PHP 5.2.14 <<< CRASH!

Fedora 32Bit / Apache 2.2.15 / PHP 5.3.3 --> OK

Ubuntu 10.10 32Bit / Apache2 2.2.16 / PHP 5.3.3 -> OK

Test script:
---
'.PHP_EOL;



// After removing almost any of the lines inside $notworking apache will
NOT crash, no matter which line was removed in most cases.



$notworking = ' DO NOT CHANGE THIS COMMENT!

/**

* Automatically generated BaseObject for IslandStorage. !!DO NOT CHANGE
THIS BASE-CLASS!!

* CHANGES WILL BE OVERWRITTEN WHEN UPDATING!!

* You can change class "IslandStorage" which will extend this base-class.

*/

class IslandStorageBase extends AbstractSimpleStorage {

}

<*IslandStorageBase:end*>

?>';



$content = preg_replace(

  '%//<\*IslandStorageBase:start\*>(.)+<\*IslandStorageBase:end\*>%s',

  'test',

  $notworking

);



echo 'If you can see this everything seems to be working fine.';



?>

Expected result:

Is the following crashing apache or whatever?

If you can see this everything seems to be working fine.

Actual result:
--
Apache crashes with the following log entry:



Parent: child process exited with status xyz -- Restarting.

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



Bug #54317 [Com]: Regexp crashes Apache/PHP

2011-03-25 Thread christian dot achatz at adventure-php-framework dot org
Edit report at http://bugs.php.net/bug.php?id=54317&edit=1

 ID: 54317
 Comment by: christian dot achatz at adventure-php-framework dot
     org
 Reported by:christian dot achatz at adventure-php-framework
 Summary:Regexp crashes Apache/PHP
 Status: To be documented
 Type:   Bug
 Package:Regexps related
 Operating System:   Windows
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

Thanks for your analysis. I'll try the solution described on the MSDN
article.


Previous Comments:

[2011-03-19 17:56:35] paj...@php.net

Maybe worth adding my last comment to the PHP manual.


[2011-03-19 17:56:09] paj...@php.net

Stack size problem. You can run the script through the CLI sapi to see
that PHP 

actually works. However Apache has a smaller stack and causes such
regexp to crash 

(or similar side effect). Increase the stack of Apache to fix this
problem. Use 

Editbin for that:
http://msdn.microsoft.com/en-us/library/d25ddyfc(v=VS.80).aspx


[2011-03-19 16:05:27] christian dot achatz at adventure-php-framework

Description:

---

>From manual page: http://www.php.net/function.preg-replace#Description

---

Calling the script below apache crashes on windows installations. After
removing almost any of the lines inside $notworking apache will NOT
crash, no matter which line was removed in most cases.





Here is the system list that causes a crash or not:



Windows 7 SP1 (64bit) | XAMPP | Apache/2.2.17 (Win32) | PHP 5.3.5 |
<<<<<<< CRASH!

Windows XP (32+64bit) | XAMPP | Apache 2.2.17 | PHP 5.3.5 | <<<<<<<
CRASH!

WinXP 32Bit / Apache 2.2.17 / PHP 5.2.14 <<<<<<< CRASH!

Fedora 32Bit / Apache 2.2.15 / PHP 5.3.3 --> OK

Ubuntu 10.10 32Bit / Apache2 2.2.16 / PHP 5.3.3 -> OK

Test script:
---
'.PHP_EOL;



// After removing almost any of the lines inside $notworking apache will
NOT crash, no matter which line was removed in most cases.



$notworking = ' DO NOT CHANGE THIS COMMENT!

/**

* Automatically generated BaseObject for IslandStorage. !!DO NOT CHANGE
THIS BASE-CLASS!!

* CHANGES WILL BE OVERWRITTEN WHEN UPDATING!!

* You can change class "IslandStorage" which will extend this
base-class.

*/

class IslandStorageBase extends AbstractSimpleStorage {

}

<*IslandStorageBase:end*>

?>';



$content = preg_replace(

  '%//<\*IslandStorageBase:start\*>(.)+<\*IslandStorageBase:end\*>%s',

  'test',

  $notworking

);



echo 'If you can see this everything seems to be working fine.';



?>

Expected result:

Is the following crashing apache or whatever?

If you can see this everything seems to be working fine.

Actual result:
--
Apache crashes with the following log entry:



Parent: child process exited with status xyz -- Restarting.






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


[PHP-BUG] Bug #60073 [NEW]: crypt() creates different output in 5.2.17 and 5.3.8

2011-10-16 Thread christian dot achatz at adventure-php-framework dot org
From: 
Operating system: Windows 32Bit (Windows XP)
PHP version:  5.3.8
Package:  hash related
Bug Type: Bug
Bug description:crypt() creates different output in 5.2.17 and 5.3.8

Description:

Updating from PHP 5.2.17 to 5.3.8 today I was facing a login ussue with the
APF user management module that calculates password hashed based on the
crypt() function. 

Finally, I was able to reduce the problem to one single line with the
password hash provider implementation that calculates the user's password
hash compared to the one stored within the database using a static and
dynamic salt applied to crypt() together with the password. Here are the
relevant loc:

public function createPasswordHash($password, $dynamicSalt) {
   return crypt($password . $this->getHardCodedSalt(), '$2a$07$' .
$dynamicSalt . '$');
}

This call results in different hashes for PHP 5.2.17/Win32 and PHP
5.3.8/Win32 both operated on a 2.2 Apache. In PHP 5.3.8/Win32 it seems that
PHP falls back to standard Standard DES since the salt is included as
clear-text in the hash key. As noted on http://de.php.net/crypt PHP only
falls back to it's own blowfish implementation in case the system brings no
support. Obviously, this is not as the manual tells us.

The below test script includes the code that I have created to reproduce
this issue both on my local webserver and the CLI.

Test script:
---
Apache version:
// PHP version   : 5.3.8
// Password  : bob marley
// Static salt   : my-secret
// Dynamic salt  : 4eea9621afdad9f067e12d281b84f316
// Password hash :
$2a$07$4eea9621afdad9f067e12OIcKkEFDgkmF11Aln8i4xX1m8Pv.mXyy
//
// $ ./php -f ../Apache2.2/htdocs/www/crypt_issue.php
// Apache version:
// PHP version   : 5.2.17
// Password  : bob marley
// Static salt   : my-secret
// Dynamic salt  : 4eea9621afdad9f067e12d281b84f316
// Password hash : $2C9b17FGUTd.
?>

Expected result:

The expected result is "$2C9b17FGUTd." for the password hash both for PHP
5.2.17/Win32 and PHP 5.3.8/Win32.

Actual result:
--
The actual result is "$2C9b17FGUTd." for PHP 5.2.17/Win32 and
"$2a$07$4eea9621afdad9f067e12OIcKkEFDgkmF11Aln8i4xX1m8Pv.mXyy" for PHP
5.3.8/Win32.

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