Hi Apostolos,
> > java("java.sql.Date")->valueOf(...);
> That did not work.
The procedure "java" is defined in Java.inc (bridge version 4.0.0 and above) as:
function Java($name) {
static $classMap = array();
if(array_key_exists($name, $classMap)) return $classMap[$name];
return $classMap[$name]=new JavaClass($name);
}
> I can howeever create an instance of java.sql.Date even
> if no such constructor exists (bug?)
No, it's a feature. People used to access the class this way. It is not a good practice, but it
works and it will work in all future releases of the bridge.
When the high-level API is used (PHP 6 and PHP/Java Bridge 4.3 or above) one can access the
type in a more intuitive way:
$date = java_sql_Date::type()->valueOf("2007-12-07");
When the new syntax is used,
new java_sql_Date()
will throw a JavaException, of course.
Regards,
Jost Boekemeier
________
Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever
|