global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / asm_assert_optobj.hhas
blob218c69e12327aece1c23a110c6d790d39e0f7ce2
1 .main {
2   DefCls 0
4   NewObjD "Foo"
5   Dup
6   FPushCtor 0
7   FCall <> 0 1 "" - "" ""
8   PopC
9   SetL $object
10   PopC
12   CGetL $object
13   FPushObjMethodD 1 "main" NullThrows
14    NewObjD "Foo"
15    Dup
16    FPushCtor 0
17    FCall <> 0 1 "" - "" ""
18    PopC
19   FCall <> 1 1 "" - "" ""
20   PopC
22   CGetL $object
23   FPushObjMethodD 1 "main" NullThrows
24    Null
25   FCall <> 1 1 "" - "" ""
26   PopC
28   Int 1
29   RetC
32 .class [unique] Foo {
33   .default_ctor;
35   .property [public] x = """s:3:"heh";""";
37   .method [public] __toString() {
38     String "hey\n"
39     RetC
40   }
42   # Do all this work in a member function so that we will assert
43   # specific object types without RepoAuthoritative mode
44   .method [public] main($x) {
45     # Test that the guard for an optional AssertObj stays: we could be
46     # called with the object or nulls.
48     AssertRATL $x ?Obj=Foo
49     CGetL $x
50     Print
51     PopC
52     BaseL $x Warn
53     QueryM 0 CGet PT:"x"
54     PopC
55     Int 1
56     RetC
57   }