Based off your code the ATest class is not using the interface correctly
(having params in methods from the interface which have no params.) Fatal
Errors stop script execution, so my initial thought is, fix ATest and I am
sure that User will error next.

On Wed, Apr 16, 2008 at 4:56 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

> By the way, you can also use this link for some of the SPL Standard
> Library 
> http://www.php.net/~helly/php/ext/spl/<http://www.php.net/%7Ehelly/php/ext/spl/>
>
> On Wed, Apr 16, 2008 at 5:38 PM, Keith Pope <[EMAIL PROTECTED]> wrote:
>
> >
> > 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.
> >
>
>
>
> --
> Arthur N. Layese, Software Engineer
> InfoWeapons Corporation
> Unit 702, 7/F Skyrise Bldg.,
> Asiatown I.T. Park, Apas
> Cebu City, Philippines 6000
>
> Phones: +63.32.238.0088 , +63.32.415.8442
> Fax: +63.32.238.0077
> Mobile: +63.917.810.2982
> Emails: [EMAIL PROTECTED] , [EMAIL PROTECTED]
> Websites: http://arthur.layese.com , http://www.infoweapons.com ,
> http://artiskool.blogspot.com
>
>
> Favorite Quotes:
>
> For I know the plans I have for you," declares the LORD, "plans to prosper
> you and not to harm you, plans to give you hope and a future.
> -- Jeremiah 29:11 - New International Version (NIV)
>
> --------
> This email and/or attachments are confidential and may also be
> legally privileged. If you are not the intended recipient, you are
> hereby notified, that any review, dissemination, distribution or
> copying of this email and/or attachments is strictly prohibited.
> Please notify [EMAIL PROTECTED] immediately by email and
> delete this message and all its attachments. Thank you.
>

Reply via email to