One could ask if it would just pass to
the constructor, but it doesn't. I don't know if there's a technical
reason
for that or if just no one implemented it, but the short answer is The
language doesn't do that.
That's what i was asking about, when trying to cast something into a non
I was asking myself if there was a good reason this syntax not to work
class string_extented{
function __construct($str){
$this-contents=$str;
}
function __toString(){
return $this-contents;
}
}
//that's working fine
$test= new string_extended(this is my anonymous string);
echo $test;
/that's
//that's working fine
$test= new string_extended(this is my anonymous string);
echo $test;
/that's not working, but should'nt it be the case ?
$test = (string_extended) This is my anonymous string;
echo $test;
I'll find this very usefull :x, it's just a syntax ehancement nope ?
Can't give
On Tue, Jun 10, 2008 at 5:42 AM, Richard Heyes [EMAIL PROTECTED] wrote:
//that's working fine
$test= new string_extended(this is my anonymous string);
echo $test;
/that's not working, but should'nt it be the case ?
$test = (string_extended) This is my anonymous string;
echo $test;
I'll
On Tuesday 10 June 2008, Leurent Francois wrote:
I was asking myself if there was a good reason this syntax not to work
class string_extented{
function __construct($str){
$this-contents=$str;
}
function __toString(){
return $this-contents;
}
}
//that's working fine
$test= new
On Tue, Jun 10, 2008 at 5:13 AM, Leurent Francois [EMAIL PROTECTED]
wrote:
I was asking myself if there was a good reason this syntax not to work
class string_extented{
function __construct($str){
$this-contents=$str;
}
function __toString(){
return $this-contents;
}
}
//that's
6 matches
Mail list logo