FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
memcache/example.php at master · OTTO11/memcache · GitHub
OTTO11
/
memcache
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
memcache
/
example.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (21 loc) · 725 Bytes
Breadcrumbs
memcache
/
example.php
Copy path
File metadata and controls
26 lines (21 loc) · 725 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?
/*
* @Author: Alexander Nagnitchenko
* @link: https://vk.com/otto_rocket
* @file: example.php
*/
$
start
=
microtime
(
true
);
$
mm
=
memory_get_peak_usage
();
error_reporting
(
E_ALL
);
require
(
'
./memcache.php
'
);
$
cache
=
new
Memcache
();
$
cache
->
addServer
(
'
localhost
'
,
11211
,
30
);
$
cache
->
set
(
'
my_test1
'
,
'
test_value_1
'
);
$
cache
->
set
(
'
my_test2
'
,
array
(
1
,
'
foo
'
=>
'
bar
'
,
3
));
$
cache
->
set
(
'
my_test3
'
,
11211
);
$
cache
->
set
(
'
my_ololo
'
,
'
ololo
'
);
$
cache
->
add
(
'
myfirst
'
,
1000
,
MEMCACHE_COMPRESSED
,
15
);
$
cache
->
set
(
'
1^2^mysecond1
'
,
2000
,
MEMCACHE_COMPRESSED
,
15
);
print_r
(
$
cache
->
get
(
array
(
'
my_test1
'
,
'
my_test2
'
,
'
1^2^mysecond1
'
)) );
echo
microtime
(
true
)-
$
start
.
"\n"
;
echo
(
memory_get_peak_usage
()-
$
mm
)/(
1024
*
1024
);
Back
|
FazBrowse Home
|
New Git URL