FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
msgpack/php/tests/019.phpt at java-0.5.1 · WanderWalker/msgpack · GitHub
WanderWalker
msgpack
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
msgpack
/
php
/
tests
/
019.phpt
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (38 loc) · 798 Bytes
Breadcrumbs
msgpack
/
php
/
tests
/
019.phpt
Copy path
File metadata and controls
43 lines (38 loc) · 798 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
Object test, __autoload
--SKIPIF--
--FILE--
<?php
if
(!
extension_loaded
(
'
msgpack
'
)) {
dl
(
'
msgpack.
'
.
PHP_SHLIB_SUFFIX
);
}
function
test
(
$
type
,
$
variable
,
$
test
) {
$
serialized
=
pack
(
'
H*
'
,
$
variable
);
$
unserialized
=
msgpack_unserialize
(
$
serialized
);
echo
$
type
,
PHP_EOL
;
echo
bin2hex
(
$
serialized
),
PHP_EOL
;
var_dump
(
$
unserialized
);
echo
$
test
||
$
unserialized
->
b
==
2
?
'
OK
'
:
'
ERROR
'
,
PHP_EOL
;
}
function
__autoload
(
$
classname
) {
class
Obj {
var
$
a
;
var
$
b
;
function
__construct
(
$
a
,
$
b
) {
$
this
->
a
=
$
a
;
$
this
->
b
=
$
b
;
}
}
}
test
(
'
autoload
'
,
'
83c0a34f626aa16101a16202
'
,
false
);
?>
--EXPECTF--
autoload
83c0a34f626aa16101a16202
object(Obj)#%d (2) {
["a"]=>
int(1)
["b"]=>
int(2)
}
OK
Back
|
FazBrowse Home
|
New Git URL