Sachin Raut
2014-07-31 08:03:51 UTC
Hi
I have a question in this following code.
<?php
class A
{
public $country;
function __construct($data=array())
{
if(!isset($data))
{
trigger_error("Couldn't construct address with a ".get_class());
}
}
}
$obj=new A();
?>
I am not sending any "array" as an argument while creating an object. And
hence "if statement" in constructor should have been executed, but it
displays blank page. My query is why it's not executing "if statement"?
Thanks
Sachin
I have a question in this following code.
<?php
class A
{
public $country;
function __construct($data=array())
{
if(!isset($data))
{
trigger_error("Couldn't construct address with a ".get_class());
}
}
}
$obj=new A();
?>
I am not sending any "array" as an argument while creating an object. And
hence "if statement" in constructor should have been executed, but it
displays blank page. My query is why it's not executing "if statement"?
Thanks
Sachin