Re: ways of making access and visib compat with 4 and 5

From: Date: Mon, 14 Mar 2005 12:26:39 +0000
Subject: Re: ways of making access and visib compat with 4 and 5
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38893@lists.php.net to get a copy of this message
tony yau wrote:
hi all, I'm trying to make my classes compat with php4 and php5 is there a way of doing something like this: if( version== 4)
    define( "VISIBILITY", "" );
else if (version==5)
    define( "VISIBILITY", "protected" );
class Flex {
     VISIBILITY function CompatFunc();
}
No, seems to me this is not possible. A trick i'm using is this: Class Foo { /* protected */ function Bar() {} } While I'm running PHP4, the class is as above. As soon as I'm switching to PHP5, I do a find and replace and remove the comments.... Erwin P.S. This is a database-related malinglist ;)

« previous php.db (#38893) next »