Simply, let me explain by an example.
<?php
class My extends Thread {
public function run() {
/** ... **/
}
}
$my = new My();
var_dump($my->start());
?>
This is from PHP manual.
I am wondering if there is a way to do this in more Java-like fashion. For example:
<?php
$my = new Thread(){
public function run() {
/** ... **/
}
};
var_dump($my->start());
?>
You do have access ev(a|i)l. If you used traits to compose your class it COULD be possible to do this.
This outputs ...
So you CAN, but not sure if you SHOULD.