daarius
10-07-2005, 11:55 AM
Hi, while my implementation of database package exactly similar to Java2's java.sql i have come across a problem. there seems to be limitation in PHP, which may be someone will know workaround it?
example is below:
interface Statement {
public function addBatch($sql) {
}
// ...
}
interface PreparedStatement extends Statement {
public function getMetaData() {
}
// ...
}
// Now implementation
class MysqlStatement implements Statement {
public function addBatch($sql) {
}
// ...
}
// all is fine till here...
class MysqlPreparedStatement extends MysqlStatement implements Prepared Statement {
public function addBatch() {
}
// ...
}
problem with above class mysqlpreparedstatement. i get fatal error that addBatch() in mysqlpreparedstatement must have same amount of arguments as in interface Statement. But, i would think that MysqlStatement has implemented it properly, and now child MysqlPreparedStatement is simply extending addBatch() funciton, but without the arguments, which is allowed in PHP.
any thoughts?
example is below:
interface Statement {
public function addBatch($sql) {
}
// ...
}
interface PreparedStatement extends Statement {
public function getMetaData() {
}
// ...
}
// Now implementation
class MysqlStatement implements Statement {
public function addBatch($sql) {
}
// ...
}
// all is fine till here...
class MysqlPreparedStatement extends MysqlStatement implements Prepared Statement {
public function addBatch() {
}
// ...
}
problem with above class mysqlpreparedstatement. i get fatal error that addBatch() in mysqlpreparedstatement must have same amount of arguments as in interface Statement. But, i would think that MysqlStatement has implemented it properly, and now child MysqlPreparedStatement is simply extending addBatch() funciton, but without the arguments, which is allowed in PHP.
any thoughts?