Hi this is a little off topic but I thought this would be a good place to ask, 
I have a really strange php behaviour when using an interface. I have tried 
finding a bug that matches but no success. 

Right the code:

<?php
class User implements SplSubject
{
    public function attach( SplObserver $observer )
    {
        
    }
    
    public function detach( SplObserver $observer)
    {
        
    }
    
    //this should fail with fatal??
    public function notify( $th1s, $should, $not, $work )
    {
    }
}

interface ITest
{
    public function notify();
    
    public function test();
}

class ATest implements ITest 
{
    //this should fail with fatal
    public function notify( $break )
    {
        
    }
    
    //this should work ok
    public function test( $dontBreak = 1 )
    {
        
    }
}
?>

Now when I run this I get:

<b>Fatal error</b>:  Declaration of ATest::notify() must be compatible with 
that of ITest::notify() in <b>C:\www\24dash\tests\tmp.php</b> on line 
<b>24</b><br />

Which is exactly what I would expect, but wheres my error for SplSubject???

My PHP version is 5.2.5. 

What do you think?

Thx

Keith Pope
Web Developer

--

allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, 
Hereford, HR1 3SE.

Registered in England No. 02933191. UK VAT Reg. No. 666 9148 88.



Telephone: 0870 243 3434, Fax: 0870 243 6041.

Website: www.allpay.net

Email: [EMAIL PROTECTED]



This email, and any files transmitted with it, is confidential and intended 
solely for the use of the individual or entity to whom it is addressed. If you 
have received this email in error please notify the allpay.net Information 
Security Manager at the number above.

Reply via email to