note 114071 added to function.apc-fetch
| From: | aktharmiahatgmaildotcom | Date: | Wed, 08 Jan 2014 21:34:54 +0000 |
| Subject: | note 114071 added to function.apc-fetch | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198162@lists.php.net to get a copy of this message | ||
Note apc_fetch() will return a copy of whatever is stored in the memory and not a reference to it.
For example:
<?php
class foo{
public $bar;
}
apc_add("foo", new foo());
$fooGot = apc_fetch("foo");
$fooGot->bar = 1234;
print_r(apc_fetch("foo"));
?>
will print
foo Object ( [bar] => )
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.apc-fetch.php
Edit -- https://master.php.net/note/edit/114071
Del: integrated -- https://master.php.net/note/delete/114071/integrated
Del: useless -- https://master.php.net/note/delete/114071/useless
Del: bad code -- https://master.php.net/note/delete/114071/bad+code
Del: spam -- https://master.php.net/note/delete/114071/spam
Del: non-english -- https://master.php.net/note/delete/114071/non-english
Del: in docs -- https://master.php.net/note/delete/114071/in+docs
Del: other reasons-- https://master.php.net/note/delete/114071
Reject -- https://master.php.net/note/reject/114071
Search -- https://master.php.net/manage/user-notes.php