Groups
Groups
Sign in
Groups
Groups
<?PHPalClub
Conversations
About
Send feedback
Help
OOP
3 views
Skip to first unread message
Mohammed Jebrini
unread,
Sep 27, 2010, 3:06:06 PM
9/27/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to <?PHPalClub
create file with name oop1.php :
put this content inside the file ..
<?php
class oop1
{
public $class = 'First';
}
---------------------
create another file oop2.php :
<?php
function __autoload($name)
{
require $name.'.php';
}
class MySecondPHPClass
{
private $name = null ;
public function test()
{
}
public function __set($variable, $value)
{
$this->$variable = $value ;
}
public function __get($variable)
{
return $this->$variable ;
}
public function setName($value)
{
$this->name = $value;
return $this;
}
function __isset($var)
{
isset($this->$var);
}
function __unset($var)
{
unset($this->$var);
}
function __construct($param)
{
echo " Construction ";
$oop1 = new oop1();
echo $oop1->class;
}
function __destruct()
{
echo " destruct ";
}
function __call($method,$arg)
{
echo $method ;
}
function __toString()
{
return "Name = ".$this->name;
}
function __clone(){}
}
$x = new MySecondPHPClass(10);
$x->setName('Name X ');
//var_dump(isset($x->name));
$x->setName('Mohammed');
$y = clone $x ;
//echo $x->name() ;
$y->setName('Name Y');
//echo $y."<br/>" ;
//$y->setName('Name Y');
//echo $x ;
Reply all
Reply to author
Forward
0 new messages