1. Go to this page and download the library: Download zero-config/clone library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use ZeroConfig\Cloner\Cloner;
/** @var object $original */
$cloner = new Cloner();
$copy = $cloner($original);
// Define the timezone for Holland and Amsterdam during winter.
$winter = new stdClass();
$winter->amsterdam = new stdClass();
// Holland inherits from Amsterdam.
$winter->holland = $winter->amsterdam;
// Set the timezone offset for Amsterdam.
$winter->amsterdam->offset = '+1';
// Create a deep clone of the timezone to set the summer configuration.
$summer = 🐑($winter);
// Set the offset for Holland.
$summer->holland->offset = '+2';
echo json_encode(
[
'winter' => $winter,
'summer' => $summer
],
JSON_PRETTY_PRINT
) . PHP_EOL;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.