Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<?php
class MyClass {
  public $color;
  public $amount;
}
$obj = new MyClass();
$obj->color = 'red';
$obj->amount = 5;
$copy = clone $obj;
print_r($copy);
?>
</body>
</html>
MyClass Object
(
    [color] => red
    [amount] => 5
)