Afternoon All,
Last week I got to thinking about PHP vs other languages.. sparing the
details this is what I decided I'd like my code to look like :) [what
*I* /as an OO developer/ need(?want)]
<?php
package com.mydom.thispackage
{
import com.anotherdom.MysqlDbHandler as DbHandlerA;
import com.somedom.DbHandler as DbHandlerB; # "as" makes this easier
import com.mydom.thatpackage.RssParser; # we don't have to "as"
import net.php.pecl.Tidy into TidySpace; # "into namespace"
import org.nicedom.alwaysusethese.*; # why not?
public class MyClass # visibility on classes
{
private $dba:DbHandlerA = new DbHandlerA();
private $dbb:DbHandlerB = new DbHandlerB();
protected $xmlString:String;
public function __construct( String $xml ):void #return types
{
if( TidySpace::tidy_is_xml( $xml ) ) { #namespace function call
$this->xmlString = TidySpace::tidy_repair_string( $xml );
}
}
}
}
?>
all purely a made up example; I'd be interested to here any comments or
what your ideal language (/modified php) would look like.
Regards!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php