[Phpmyadmin-devel] Overriding functions

Michal Čihař michal at cihar.com
Tue Jun 18 15:44:59 CEST 2013


Hi

Dne Tue, 18 Jun 2013 17:31:19 +0530
Madhura Jayaratne <madhura.cj at gmail.com> napsal(a):

> On Tue, Jun 18, 2013 at 2:04 PM, Ayush Chaudhary <ayushchd at gmail.com> wrote:
> 
> > Hi,
> >
> > I was writing some unit tests for the native string functions. However,
> > since some of the functions are declared twice (with different
> > implementations), for e.g., PMA_strlen, PMA_strpos, etc. have different
> > implementations in string_mb.lib.php and string_native.lib.php, it causes
> > phpunit to throw fatal errors of the form "Cannot redeclare function …
> > already declared in …"
> >
> > Possible solutions could be to use namespaces or to use polymorphism in
> > some way.
> >
> > How do you plan to use polymorphism to overcome this?
> Another way around would be to put these functions into classes and
> instantiate an object of the correct type.

This sounds like a best approach...

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20130618/9280fa1e/attachment.sig>


More information about the Developers mailing list