Re: [PHP-DEV] Using child classes/interfaces as desired type hints

2010-10-07 Thread Ferenc Kovacs
On Thu, Oct 7, 2010 at 7:56 AM, Nathan Nobbe wrote: > Hi, > > Probly rehashing an old conversation here, but I'm wondering why the > following isn't supported > > abstract class AbstractServer {} > class ConcreteServer extends AbstractServer {} > > abstract class AbstractClient { > abstract fun

Re: [PHP-DEV] Using child classes/interfaces as desired type hints

2010-10-07 Thread Ionut G. Stan
On 07/Oct/10 8:56 AM, Nathan Nobbe wrote: Hi, Probly rehashing an old conversation here, but I'm wondering why the following isn't supported Here's the problem: class ConcreteServer2 extends AbstractServer {} Now, ConcreteClient can't receive an instance of ConcreteServer2 as an a

[PHP-DEV] [PATCH] Docs say preg_match() returns FALSE on error, but it returns int(0)

2010-10-07 Thread Jamie Garside
This is a patch to fix "Bug #52732 Docs say preg_match() returns FALSE on error, but it returns int(0)" (http://bugs.php.net/bug.php?id=52732). The documentation states that preg_match should return FALSE on error, although it returns 0 if it breaks the recursion or backtrack limit. This just chec

[PHP-DEV] stat functions do each path component?

2010-10-07 Thread Scott Nichol
In comparing the performance of PHP 5.2.5 file_exists calls versus C stat calls, I discovered via Windows sysinternals ProcessMonitor that PHP seems to do a stat on each component of a file path. For example, file_exists("e:\\wamp\\www\\ra-v2\\system\\application\\libraries\\MY_Controller.php"

Re: [PHP-DEV] stat functions do each path component?

2010-10-07 Thread Ferenc Kovacs
On Thu, Oct 7, 2010 at 8:09 PM, Scott Nichol wrote: > In comparing the performance of PHP 5.2.5 file_exists calls versus C stat > calls, I discovered via Windows sysinternals > ProcessMonitor that PHP seems to do a stat on each component of a file > path. For example, > file_exists("e:\\wamp\\www

Re: [PHP-DEV] Using child classes/interfaces as desired type hints

2010-10-07 Thread Richard Lynch
On Thu, October 7, 2010 12:56 am, Nathan Nobbe wrote: > abstract class AbstractServer {} > class ConcreteServer extends AbstractServer {} > > abstract class AbstractClient { > abstract function doStuff(AbstractServer $o); > } > > class ConcreteClient extends AbstractClient { > function doStuff