Re: turning off a E_STRICT or fix for a bad coding habit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Viraj,

well from the viewpoint of the PHP developers, it depends if u allow to
extend a class before it is been declared. If it is allowed that way, then
yes you are right none of the sniped should create an error. If u study the
bug report, u will see that the class is extended before it is declared. If
u have to declare a calss before u can extend it and it is set as a rule,
then yes the interpreter should fire an error.

I think in your code must be something similar to this, extention before
declaration. I'm not shure but if PHP goes towards variable declaration
feature ( PHP 6 ? ), the result would be that extention of a class before
declaration will be prohibited.

Right now it seems to me that the interpreter is allowing extention before
declaration, however takes the first overwriting method as its declaration
and of course that would fire the error you have.

I personally have no such problems, as since ever I try to program in the
way strict languages like JAVA require and found it as best practice. That
means e.g. declaration strict before extention/use of functions and classes.
I also avoid even NOTICE messages.

One last thing, an entry in the PHP buglist doesn't mean it is a bug.

It would be helpfull to see the complete code firing this error, but I
assume its a bit large to sniip here.

ralph_deffke@xxxxxxxx


"viraj" <kalinga@xxxxxxxxx> wrote in message
news:74721f460909270203s723480d3u361ca9a18da439c4@xxxxxxxxxxxxxxxxx
> just upgraded to php 5.2.10-2.2 on debian
>
> now i get this error
>
> [2048] Declaration of form::bindData() should be compatible with that
> of db::bindData()
>
> i use __autoload to load these classes.. found this bug report
> http://bugs.php.net/bug.php?id=46851, i thought it's this new E_STRICT
> bit and tried to turn it off, but didn't help.
>
> this code was working perfect before.. even with this error.. it
> works. any idea about a workaround? or some reading suggestions!
>
> many thanks
>
> ~viraj



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux