1. Go to this page and download the library: Download hakito/publisher 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/ */
class Target
{
private function methodWithReferenceArgument(&$arg) { $arg = 'hi'; }
}
$target = new Target();
$published = new hakito\Publisher\Published($target);
$val = 'initial';
$published->methodWithReferenceArgument($val);
// $val is still 'initial'
class Target
{
private $_member = [];
private function &methodWithReferenceReturnValue($arg) { return $this->_member; }
}
$target = new Target();
$published = new hakito\Publisher\Published($target);
$val = 'initial';
$published->methodWithReferenceReturnValue($val)['new'] = 'value';
// Target::_member is still []
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.