<?php
class OS {
var $name;
function OS($name) {
$this->name = $name;
}
}
function changeName($obj, $name) {
$obj->name = $name;
}
$linux = new OS('linux');
$win = $linux->__clone();
changeName($win, 'windows');
echo $linux->name. "\n";
echo $win->name;
? >
linux
windows