Skip to content

Instantly share code, notes, and snippets.

@rightgo09
Created February 3, 2015 02:21
Show Gist options
  • Select an option

  • Save rightgo09/e7f15062e3ce5d00f644 to your computer and use it in GitHub Desktop.

Select an option

Save rightgo09/e7f15062e3ce5d00f644 to your computer and use it in GitHub Desktop.
<?php
class Hoge {
private $h;
public function __construct(&$h) {
$this->h &= $h;
}
public function hhh($str) {
$this->h["str"] = $str;
}
}
$k = array("str" => "string!!");
$hoge = new Hoge($k);
print_r($k);
$hoge->hhh("changed");
print_r($k);
//Array
//(
// [str] => string!!
//)
//Array
//(
// [str] => changed
//)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment