@@ -59,44 +59,11 @@ trait TR2 implements I0, I1<int> {
require implements I2;
}
-# For multiple declarations of the same class we union the possible base types.
-if (rand()) {
- class CL3 extends CL0 {
- use TR0;
- }
-} else {
- class CL3 implements I0 {
- use TR0;
- }
-}
-
enum E0 : int {
EV0 = 0;
EV1 = 1;
}
-if (rand()) {
- class M0 {
- }
-} else {
- interface M0 {
- }
-}
-
-if (rand()) {
- final class M1 {
- }
-} else {
- abstract class M1 {
- }
-}
-
-# Does not compile.
-# function f9() {
-# const CO6 = 1;
-# }
-
-
#
# Execute single-threaded test
#
@@ -2,13 +2,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(4383056505853746297)
+ int(710971236120442494)
["md5sum1"]=>
- int(-2974079675222806495)
+ int(7581368581380780967)
["sha1sum"]=>
- string(40) "394475b1e5c57740f3fde1b4cc1e10efc49265ba"
+ string(40) "fe215048b54d55d538c1f82799f9db15f36f3ba6"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -58,24 +58,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(3) "CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(3) "CL0"
- [1]=>
- string(2) "I0"
- [2]=>
- string(3) "TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(2) "E0"
["kindOf"]=>
string(4) "enum"
@@ -87,7 +69,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(2) "I0"
@@ -102,7 +84,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(2) "I1"
@@ -117,7 +99,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(2) "I2"
@@ -138,31 +120,7 @@ array(3) {
string(3) "CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(2) "M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(2) "M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(3) "TR0"
@@ -180,7 +138,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(3) "TR1"
@@ -198,7 +156,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(3) "TR2"
@@ -260,13 +218,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(-766628480674557984)
+ int(-6166587352886191145)
["md5sum1"]=>
- int(4132325208887423240)
+ int(3538371896544415899)
["sha1sum"]=>
- string(40) "50e891dd1b93031067bca08fb2adcd3bc9a4d0e4"
+ string(40) "de7817eb10fce40db6d90ab9ac1234fbbee4469a"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -316,24 +274,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(6) "NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(6) "NS\CL0"
- [1]=>
- string(5) "NS\I0"
- [2]=>
- string(6) "NS\TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(5) "NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -345,7 +285,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(5) "NS\I0"
@@ -360,7 +300,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(5) "NS\I1"
@@ -375,7 +315,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(5) "NS\I2"
@@ -396,31 +336,7 @@ array(3) {
string(6) "NS\CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(5) "NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(5) "NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(6) "NS\TR0"
@@ -438,7 +354,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(6) "NS\TR1"
@@ -456,7 +372,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(6) "NS\TR2"
@@ -518,13 +434,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(177695044982738465)
+ int(3932987630331472577)
["md5sum1"]=>
- int(321704508444983991)
+ int(-7802989863953681645)
["sha1sum"]=>
- string(40) "9d0fa69dd74b7da21b9fa8b3c56ef5456feffd51"
+ string(40) "2a8128c198b86655f2eb28d7b95f894f2df78608"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -574,24 +490,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(9) "NS\NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(9) "NS\NS\CL0"
- [1]=>
- string(8) "NS\NS\I0"
- [2]=>
- string(9) "NS\NS\TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(8) "NS\NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -603,7 +501,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(8) "NS\NS\I0"
@@ -618,7 +516,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(8) "NS\NS\I1"
@@ -633,7 +531,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(8) "NS\NS\I2"
@@ -654,31 +552,7 @@ array(3) {
string(9) "NS\NS\CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(8) "NS\NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(8) "NS\NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR0"
@@ -696,7 +570,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR1"
@@ -714,7 +588,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR2"
--- /dev/null
+<?hh
+
+class MyShadyObject {}
+
+$x = 1;
$vstmt = $dbh->query("select * from foo", PDO::FETCH_COLUMN, 0);
var_dump($vstmt->fetchAll());
- class MyShadyObject {
- }
+ include 'ext_pdo.inc';
//Test object fetching
foreach ($dbh->query("select * from foo", PDO::FETCH_CLASS,
@@ -59,44 +59,11 @@ trait TR2 implements I0, I1<int> {
require implements I2;
}
-# For multiple declarations of the same class we union the possible base types.
-if (rand()) {
- class CL3 extends CL0 {
- use TR0;
- }
-} else {
- class CL3 implements I0 {
- use TR0;
- }
-}
-
enum E0 : int {
EV0 = 0;
EV1 = 1;
}
-if (rand()) {
- class M0 {
- }
-} else {
- interface M0 {
- }
-}
-
-if (rand()) {
- final class M1 {
- }
-} else {
- abstract class M1 {
- }
-}
-
-# Does not compile.
-# function f9() {
-# const CO6 = 1;
-# }
-
-
#
# Execute single-threaded test
#
@@ -2,13 +2,13 @@ dict(3) {
["%s"]=>
dict(7) {
["md5sum0"]=>
- int(4383056505853746297)
+ int(710971236120442494)
["md5sum1"]=>
- int(-2974079675222806495)
+ int(7581368581380780967)
["sha1sum"]=>
- string(40) "394475b1e5c57740f3fde1b4cc1e10efc49265ba"
+ string(40) "fe215048b54d55d538c1f82799f9db15f36f3ba6"
["types"]=>
- vec(13) {
+ vec(10) {
dict(4) {
["name"]=>
string(3) "CL0"
@@ -49,20 +49,6 @@ dict(3) {
}
dict(4) {
["name"]=>
- string(3) "CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- vec(3) {
- string(3) "CL0"
- string(2) "I0"
- string(3) "TR0"
- }
- }
- dict(4) {
- ["name"]=>
string(2) "E0"
["kindOf"]=>
string(4) "enum"
@@ -118,28 +104,6 @@ dict(3) {
string(3) "CL1"
}
}
- dict(4) {
- ["name"]=>
- string(2) "M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- vec(0) {
- }
- }
- dict(4) {
- ["name"]=>
- string(2) "M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- vec(0) {
- }
- }
dict(6) {
["name"]=>
string(3) "TR0"
@@ -220,13 +184,13 @@ dict(3) {
["%s"]=>
dict(7) {
["md5sum0"]=>
- int(-766628480674557984)
+ int(-6166587352886191145)
["md5sum1"]=>
- int(4132325208887423240)
+ int(3538371896544415899)
["sha1sum"]=>
- string(40) "50e891dd1b93031067bca08fb2adcd3bc9a4d0e4"
+ string(40) "de7817eb10fce40db6d90ab9ac1234fbbee4469a"
["types"]=>
- vec(13) {
+ vec(10) {
dict(4) {
["name"]=>
string(6) "NS\CL0"
@@ -267,20 +231,6 @@ dict(3) {
}
dict(4) {
["name"]=>
- string(6) "NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- vec(3) {
- string(6) "NS\CL0"
- string(5) "NS\I0"
- string(6) "NS\TR0"
- }
- }
- dict(4) {
- ["name"]=>
string(5) "NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -336,28 +286,6 @@ dict(3) {
string(6) "NS\CL1"
}
}
- dict(4) {
- ["name"]=>
- string(5) "NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- vec(0) {
- }
- }
- dict(4) {
- ["name"]=>
- string(5) "NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- vec(0) {
- }
- }
dict(6) {
["name"]=>
string(6) "NS\TR0"
@@ -438,13 +366,13 @@ dict(3) {
["%s"]=>
dict(7) {
["md5sum0"]=>
- int(177695044982738465)
+ int(3932987630331472577)
["md5sum1"]=>
- int(321704508444983991)
+ int(-7802989863953681645)
["sha1sum"]=>
- string(40) "9d0fa69dd74b7da21b9fa8b3c56ef5456feffd51"
+ string(40) "2a8128c198b86655f2eb28d7b95f894f2df78608"
["types"]=>
- vec(13) {
+ vec(10) {
dict(4) {
["name"]=>
string(9) "NS\NS\CL0"
@@ -485,20 +413,6 @@ dict(3) {
}
dict(4) {
["name"]=>
- string(9) "NS\NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- vec(3) {
- string(9) "NS\NS\CL0"
- string(8) "NS\NS\I0"
- string(9) "NS\NS\TR0"
- }
- }
- dict(4) {
- ["name"]=>
string(8) "NS\NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -554,28 +468,6 @@ dict(3) {
string(9) "NS\NS\CL1"
}
}
- dict(4) {
- ["name"]=>
- string(8) "NS\NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- vec(0) {
- }
- }
- dict(4) {
- ["name"]=>
- string(8) "NS\NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- vec(0) {
- }
- }
dict(6) {
["name"]=>
string(9) "NS\NS\TR0"
--- /dev/null
+<?hh
+
+class MyShadyObject {}
+$x = 1;
$vstmt = $dbh->query("select * from foo", PDO::FETCH_COLUMN, 0);
var_dump($vstmt->fetchAll());
- class MyShadyObject {
- }
+ include 'ext_pdo.inc';
//Test object fetching
foreach ($dbh->query("select * from foo", PDO::FETCH_CLASS,
--- /dev/null
+<?hh
+
+class Foo { const ABC = 42; }
+$x = 1;
--- /dev/null
+<?hh
+
+class Foo { const ABC = 24; }
+$x = 1;
<?hh
if (apc_add('i_was_already_run', 1)) {
- class Foo { const ABC = 42; }
+ include 'enum-cache-1.inc';
} else {
- class Foo { const ABC = 24; }
+ include 'enum-cache-2.inc';
}
enum Bar: int {
@@ -61,38 +61,11 @@ trait TR2 implements I0, I1<int> {
require implements I2;
}
-# For multiple declarations of the same class we union the possible base types.
-if (rand()) {
- class CL3 extends CL0 {
- use TR0;
- }
-} else {
- class CL3 implements I0 {
- use TR0;
- }
-}
-
enum E0 : int {
EV0 = 0;
EV1 = 1;
}
-if (rand()) {
- class M0 {
- }
-} else {
- interface M0 {
- }
-}
-
-if (rand()) {
- final class M1 {
- }
-} else {
- abstract class M1 {
- }
-}
-
const CO5 = 1;
function f6() {
@@ -2,13 +2,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(-3861027485470727459)
+ int(5847182631555274887)
["md5sum1"]=>
- int(-8858808937750669966)
+ int(3481378507969217468)
["sha1sum"]=>
- string(40) "00c83df7c8b6dd0c49761f134c8f987277cd1f3b"
+ string(40) "1b6802d084ff6d149e4fc8732fa21ac9fa2a99fd"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -58,24 +58,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(3) "CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(3) "CL0"
- [1]=>
- string(2) "I0"
- [2]=>
- string(3) "TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(2) "E0"
["kindOf"]=>
string(4) "enum"
@@ -87,7 +69,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(2) "I0"
@@ -102,7 +84,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(2) "I1"
@@ -117,7 +99,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(2) "I2"
@@ -138,31 +120,7 @@ array(3) {
string(3) "CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(2) "M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(2) "M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(3) "TR0"
@@ -180,7 +138,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(3) "TR1"
@@ -198,7 +156,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(3) "TR2"
@@ -266,13 +224,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(6436421051758208165)
+ int(8976002834016918693)
["md5sum1"]=>
- int(9188452903145866726)
+ int(3598343421291560646)
["sha1sum"]=>
- string(40) "36de5b67b028821d73c62f34ec9dd23df48b1d1a"
+ string(40) "a8d9ef14bdef31963d04d6876091a838affc294d"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -322,24 +280,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(6) "NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(6) "NS\CL0"
- [1]=>
- string(5) "NS\I0"
- [2]=>
- string(6) "NS\TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(5) "NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -351,7 +291,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(5) "NS\I0"
@@ -366,7 +306,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(5) "NS\I1"
@@ -381,7 +321,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(5) "NS\I2"
@@ -402,31 +342,7 @@ array(3) {
string(6) "NS\CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(5) "NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(5) "NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(6) "NS\TR0"
@@ -444,7 +360,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(6) "NS\TR1"
@@ -462,7 +378,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(6) "NS\TR2"
@@ -530,13 +446,13 @@ array(3) {
["%s"]=>
array(7) {
["md5sum0"]=>
- int(-8066121374149064878)
+ int(-6054288473884565970)
["md5sum1"]=>
- int(-297091211146495419)
+ int(3406070686178755711)
["sha1sum"]=>
- string(40) "60552768b310b10c09a65f11649b58630deebeec"
+ string(40) "1a64239b4ab6e3bffc67b8cbf2ce008c22e3a130"
["types"]=>
- array(13) {
+ array(10) {
[0]=>
array(4) {
["name"]=>
@@ -586,24 +502,6 @@ array(3) {
[3]=>
array(4) {
["name"]=>
- string(9) "NS\NS\CL3"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(4)
- ["baseTypes"]=>
- array(3) {
- [0]=>
- string(9) "NS\NS\CL0"
- [1]=>
- string(8) "NS\NS\I0"
- [2]=>
- string(9) "NS\NS\TR0"
- }
- }
- [4]=>
- array(4) {
- ["name"]=>
string(8) "NS\NS\E0"
["kindOf"]=>
string(4) "enum"
@@ -615,7 +513,7 @@ array(3) {
string(14) "HH\BuiltinEnum"
}
}
- [5]=>
+ [4]=>
array(5) {
["name"]=>
string(8) "NS\NS\I0"
@@ -630,7 +528,7 @@ array(3) {
array(0) {
}
}
- [6]=>
+ [5]=>
array(5) {
["name"]=>
string(8) "NS\NS\I1"
@@ -645,7 +543,7 @@ array(3) {
array(0) {
}
}
- [7]=>
+ [6]=>
array(5) {
["name"]=>
string(8) "NS\NS\I2"
@@ -666,31 +564,7 @@ array(3) {
string(9) "NS\NS\CL1"
}
}
- [8]=>
- array(4) {
- ["name"]=>
- string(8) "NS\NS\M0"
- ["kindOf"]=>
- string(5) "mixed"
- ["flags"]=>
- int(5)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [9]=>
- array(4) {
- ["name"]=>
- string(8) "NS\NS\M1"
- ["kindOf"]=>
- string(5) "class"
- ["flags"]=>
- int(7)
- ["baseTypes"]=>
- array(0) {
- }
- }
- [10]=>
+ [7]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR0"
@@ -708,7 +582,7 @@ array(3) {
array(0) {
}
}
- [11]=>
+ [8]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR1"
@@ -726,7 +600,7 @@ array(3) {
array(0) {
}
}
- [12]=>
+ [9]=>
array(6) {
["name"]=>
string(9) "NS\NS\TR2"
--- /dev/null
+<?php
+
+class C {}
+$x = 1;
@@ -7,8 +7,7 @@ function test() {
var_dump(is_subclass_of('C', 'D'));
var_dump(get_class_methods('C'));
var_dump(method_exists('C', 'foo'));
- class C {
-}
+ include '1377.inc';
var_dump(is_subclass_of('C', 'D'));
var_dump(is_subclass_of('C', 'C'));
}
--- /dev/null
+<?hh
+
+class MyShadyObject {}
+$x = 1;
$vstmt = $dbh->query("select * from foo", PDO::FETCH_COLUMN, 0);
var_dump($vstmt->fetchAll());
- class MyShadyObject {
- }
+ include 'ext_pdo.inc';
//Test object fetching
foreach ($dbh->query("select * from foo", PDO::FETCH_CLASS,
--- /dev/null
+<?php
+
+abstract class Middle extends Base {
+ abstract function abs();
+
+ function concrete_override() {
+ $x = parent::concrete_override();
+ return null;
+ }
+}
+class Derived extends Middle {
+ function abs() {}
+}
+$x = 1;
--- /dev/null
+<?php
+
+
+class Derived extends Base {
+ function concrete_override() { return 2; }
+}
+$x = 1;
@@ -14,21 +14,9 @@ function main(Base $b) {
<<__EntryPoint>>
function main_func_family_009() {
if (mt_rand() > 100) {
- abstract class Middle extends Base {
- abstract function abs();
-
- function concrete_override() {
- $x = parent::concrete_override();
- return null;
- }
- }
- class Derived extends Middle {
- function abs() {}
- }
+ include 'func_family_009-1.inc';
} else {
- class Derived extends Base {
- function concrete_override() { return 2; }
- }
+ include 'func_family_009-2.inc';
}
main(new Base);
--- /dev/null
+<?php
+
+class Bar {
+ const A = "asd";
+}
+$x = 1;
--- /dev/null
+<?php
+
+class Bar {
+ const B = 42;
+}
+$x = 1;
@@ -25,13 +25,9 @@ function main() {
<<__EntryPoint>>
function main_private_props_006() {
if (mt_rand()) {
- class Bar {
- const A = "asd";
- }
+ include 'private_props_006-1.inc';
} else {
- class Bar {
- const B = 42;
- }
+ include 'private_props_006-2.inc';
}
main();
--- /dev/null
+<?php
+
+class L { const A = 2; }
+$x = 1;
--- /dev/null
+<?php
+
+class L { const A = 3; }
+$x = 1;
--- /dev/null
+<?php
+
+class X {
+ public function generator() {
+ yield 0;
+ yield 1;
+ }
+}
+$x = 1;
--- /dev/null
+<?php
+
+class X {
+ public function generator() {
+ yield 1;
+ yield 2;
+ }
+}
+$x = 1;
@@ -9,20 +9,10 @@ function decide() {
function main_2192() {
if (decide()) {
- class X {
- public function generator() {
- yield 0;
- yield 1;
- }
- }
+ include '2192-1.inc';
}
else {
- class X {
- public function generator() {
- yield 1;
- yield 2;
- }
- }
+ include '2192-2.inc';
}
$x = new X;
foreach ($x->generator() as $v) {
--- /dev/null
+<?php
+
+class X {}
+$x = 1;
<?php
function h() {
- class X{
+ include '1831.inc';
}
-;
- }
function f($a, $b, $c) {
return h();
- }
+}
function g($a, $b, $c) {
return f($a++, $b++ + $a++, $c);
}
--- /dev/null
+<?php
+
+class X {}
+$x = 1;
function id($a) {
return $a;
- }
+}
class X {
}
class Y extends X {
- function t() {
+ function t() {}
}
- }
function test() {
id(new Y)->t();
}
<<__EntryPoint>>
function main_1836() {
-if (0) {
- class X {
-}
-}
+ if (0) {
+ include '1836.inc';
+ }
}
+++ /dev/null
-<?php
-
-function test() {
- class test {
- function p() {
- print 'test';
-}
- }
-}
-
- <<__EntryPoint>>
-function main_10() {
-test();
- $obj = new Test();
- $obj->p();
-}
+++ /dev/null
-test
\ No newline at end of file
+++ /dev/null
-<?php
-
-class test {
- function p() {
- print 'test';
-}
- }
-
- <<__EntryPoint>>
-function main_8() {
-$obj = new Test();
- $obj->p();
-}
+++ /dev/null
-test
\ No newline at end of file
--- /dev/null
+<?php
+
+ class A {
+ static $a = 'A';
+ static function f() {
+ echo static::$a;
+ }
+ function g() {
+ $this->f();
+ }
+ }
+ $x = 1;
--- /dev/null
+<?php
+
+class A {}
+$x = 1;
function f() {
return true;
- }
-if (f()) {
- class A {
- static $a = 'A';
- static function f() {
- echo static::$a;
- }
- function g() {
- $this->f();
- }
- }
}
- else {
- class A {
- }
+if (f()) {
+ include '1880-1.inc';
+} else {
+ include '1880-2.inc';
}
class B extends A {
static $a = 'B';
- }
+}
$b = new B;
$b->g();
--- /dev/null
+<?php
+
+namespace A\B;
+class B {
+ static $baz = 'baz';
+ const FOO = 30;
+ function f() {
+ return Foo::NoSuchConstant;
+ }
+}
+$x = 1;
--- /dev/null
+<?php
+
+namespace A\B;
+class B {
+ static $baz = 'baz';
+ const FOO = 30;
+ function f() {
+ return Foo::NoSuchConstant;
+ }
+}
+$x = 1;
@@ -17,22 +17,10 @@ class Foo {
<<__EntryPoint>>
function main_2227() {
if (\rand(0, 1)) {
- class B {
- static $baz = 'baz';
- const FOO = 30;
- function f() {
- return Foo::NoSuchConstant;
- }
- }
+ include '2227-1.inc';
}
else {
- class B {
- static $baz = 'baz';
- const FOO = 30;
- function f() {
- return Foo::NoSuchConstant;
- }
- }
+ include '2227-2.inc';
}
$f = new Foo(array(0));
\var_dump(Foo::$baz);
--- /dev/null
+<?php
+
+class A {}
+$x = 1;
@@ -4,7 +4,7 @@ namespace {
function __autoload($a) {
\var_dump($a);
if ($a == 'A') {
- class A {};
+ include 'autoload.inc';
}
}
}
--- /dev/null
+<?php
+
+ class Zoo {
+ const Bar = 2;
+ }
+$x = 1;
--- /dev/null
+<?php
+
+ class Zoo {
+ const Baz = 4;
+ }
+$x = 1;
@@ -4,13 +4,9 @@ function __autoload($x) {
$GLOBALS['y'] = new stdclass;
if (mt_rand()) {
- class Zoo {
- const Bar = 2;
- }
+ include 'static_inits_2-1.inc';
} else {
- class Zoo {
- const Baz = 4;
- }
+ include 'static_inits_2-2.inc';
}
}
--- /dev/null
+<?php
+
+class X {}
+$x = 1;
--- /dev/null
+<?php
+
+class X {
+ function foo() {
+ var_dump(__METHOD__);
+ }
+}
+$x = 1;
<?php
if (isset($g)) {
- class X {
-}
- }
-else {
- class X {
- function foo() {
- var_dump(__METHOD__);
- }
- }
+ include '763-1.inc';
+} else {
+ include '763-2.inc';
}
class Y extends X {
function foo() {
@@ -17,8 +11,7 @@ class Y extends X {
parent::foo();
}
}
-class Z extends X {
-}
+class Z extends X {}
function test($t) {
var_dump('test:'.$t);
(new $t(1,2))->foo();
--- /dev/null
+<?php
+
+class A {}
+$x = 1;
--- /dev/null
+<?php
+
+ class A {
+ static $a = 100;
+ var $b = 1000;
+ }
+$x = 1;
@@ -11,14 +11,10 @@ class B {
<<__EntryPoint>>
function main_684() {
if (f()) {
- class A {
- }
+ include '684-1.inc';
}
else {
- class A {
- static $a = 100;
- var $b = 1000;
- }
+ include '684-2.inc';
}
$vars = get_class_vars('A');
asort(&$vars);
--- /dev/null
+<?php
+
+class A {
+ var $a0;
+ static $a1 = 1;
+ static $a2 = 2;
+}
+class X {
+ var $x0;
+ static $x1 = 1;
+ static $x2 = 2;
+}
+$x = 1;
--- /dev/null
+<?php
+
+class A {
+ var $a3;
+ static $a4 = 4;
+ static $a5 = 5;
+}
+class X {
+ var $y3;
+ static $y4 = 4;
+ static $y5 = 5;
+}
+$x = 1;
<?php
if (true) {
- class A {
- var $a0;
- static $a1 = 1;
- static $a2 = 2;
- }
- class X {
- var $x0;
- static $x1 = 1;
- static $x2 = 2;
- }
+ include '685-1.inc';
}
else {
- class A {
- var $a3;
- static $a4 = 4;
- static $a5 = 5;
- }
- class X {
- var $y3;
- static $y4 = 4;
- static $y5 = 5;
- }
+ include '685-2.inc';
}
class B extends A {
var $b0 = 3;
--- /dev/null
+<?php
+
+class R {}
+$x = 1;
@@ -66,8 +66,7 @@ $obj = new C;
$obj->bar2();
var_dump(serialize($obj));
if (false) {
- class R{
-}
+ include '686.inc';
}
$d = new D;
$d->qq();
--- /dev/null
+<?php
+
+class X {}
+$x = 1;
@@ -18,10 +18,8 @@ function test() {
<<__EntryPoint>>
function main_688() {
-;
-if (0) {
- class X{
-}
- }
-test();
+ if (0) {
+ include '688.inc';
+ }
+ test();
}
+++ /dev/null
-<?hh
-
-if (true) {
- class A {} // bad
-} else {
- class B {} // bad
-}
+++ /dev/null
--vRuntime.Hack.Lang.Phpism.DisableNontoplevelDeclarations=false
--vEval.EnablePHP=1
+++ /dev/null
--vHack.Lang.Phpism.DisableNontoplevelDeclarations=false
--vEval.EnablePHP=1
+++ /dev/null
-<?hh
-function foo() : void {
- class bar {};
-}
+++ /dev/null
--vRuntime.Hack.Lang.Phpism.DisableNontoplevelDeclarations=false
--vEval.EnablePHP=1
+++ /dev/null
--vHack.Lang.Phpism.DisableNontoplevelDeclarations=false
--vEval.EnablePHP=1
--- /dev/null
+<?php
+
+class C {}
+$x = 1;
--- /dev/null
+<?php
+
+class M { function foo() {} }
+$x = 1;
--- /dev/null
+<?php
+
+class C {}
+class M {}
+$x = 1;
function __autoload($name) {
switch ($name) {
- case 'C': class C {
-}
- break;
- case 'M': class M {
- function foo() {
-}
- }
- break;
- default: class C{
-}
- class M {
-}
+ case 'C': include '1353-1.inc'; break;
+ case 'M': include '1353-2.inc'; break;
+ default: include '1353-3.inc'; break;
}
var_dump($name);
}
<?php
-function main() {
-
class A {
public function b() {}
}
@@ -26,13 +24,9 @@ class J {
}
class K extends J implements H {}
-var_dump(get_class_methods('C'));
-var_dump(get_class_methods('G'));
-var_dump(get_class_methods('K'));
-
-}
-
<<__EntryPoint>>
function main_case_insensitive_get_class_methods() {
-main();
+ var_dump(get_class_methods('C'));
+ var_dump(get_class_methods('G'));
+ var_dump(get_class_methods('K'));
}
--- /dev/null
+<?php
+
+class AaaA {
+ function f() {
+ var_dump(get_class());
+ }
+}
+$x = 1;
--- /dev/null
+<?php
+
+class aAAa {}
+$x = 1;
@@ -7,15 +7,10 @@ class BbBb {
function main_1356() {
$z=true;
if ($z) {
- class AaaA {
- function f() {
- var_dump(get_class());
- }
- }
+ include '1356-1.inc';
}
else {
- class aAAa {
-}
+ include '1356-2.inc';
}
$r = new ReflectionClass('aaaa');
var_dump($r->getName());
--- /dev/null
+<?php
+
+class A extends Base {}
+$x = 1;
--- /dev/null
+<?php
+
+class A extends Base {}
+$x = 1;
@@ -8,12 +8,9 @@ class Base {
}
$condition = 123;
if ($condition) {
- class A extends Base {
-}
-}
- else {
- class A extends Base {
-}
+ include '1360-1.inc';
+} else {
+ include '1360-2.inc';
}
class B extends A {
function bar() {
<?hh
+class C {}
+
<<__Rx>>
function test() {
- class C {} // DefCls
- // we don't emit DefClsNop outside of systemlib
class_alias('C', 'D'); // AliasCls
// we don't emit DefTypeAlias outside of pseudo-mains
-Verification Error (unit %s/test/slow/rx/body/defines-includes.php func test): defines/includes are forbidden in Rx functions: DefCls
-
Verification Error (unit %s/test/slow/rx/body/defines-includes.php func test): defines/includes are forbidden in Rx functions: AliasCls
Verification Error (unit %s/test/slow/rx/body/defines-includes.php func test): defines/includes are forbidden in Rx functions: InclOnce
--- /dev/null
+<?php
+
+class X {}
+$x = 1;
<?php
+
+<<__EntryPoint>>
function main() {
$str = 'O:1:"X":0:{}';
$obj = unserialize($str);
var_dump($obj); // incomplete class
apc_store('foo', $obj);
- class X {};
+ include 'incomplete_class_apc_serialize.inc';
$o2 = apc_fetch('foo');
var_dump($o2); // real X
}
-
-<<__EntryPoint>>
-function main_incomplete_class_apc_serialize() {
-main();
-}
<?php
-
-<<__EntryPoint>>
-function main_2127() {
-if (true) {
trait T {
public static function foo() {
echo "Foo\n";
@@ -12,6 +8,4 @@ if (true) {
class C {
use T;
}
-}
-C::foo();
-}
+$x = 1;
<<__EntryPoint>>
function main_2127() {
if (true) {
- trait T {
- public static function foo() {
- echo "Foo\n";
- }
- }
- class C {
- use T;
- }
+ include '2127.inc';
}
C::foo();
}
--- /dev/null
+<?php
+
+class A {}
+$x = 1;
@@ -24,9 +24,9 @@ class C extends B {}
<<__EntryPoint>>
function main_abstract_final_override() {
-if (isset($g)) {
- class A {}
-}
+ if (isset($g)) {
+ include 'abstract-final-override.inc';
+ }
-var_dump(new C);
+ var_dump(new C());
}
--- /dev/null
+<?php
+
+class C1 {
+ use NonExistent;
+}
+$x = 1;
--- /dev/null
+<?php
+
+class C2 {
+ use NonExistent;
+}
+$x = 1;
function main_conditional_fatal() {
$execute_fatal = false;
if ($execute_fatal) {
- class C1 {
- use NonExistent;
- }
+ include 'conditional_fatal-1.inc';
}
echo 'Good', "\n";
$execute_fatal = true;
if ($execute_fatal) {
- class C2 {
- use NonExistent;
- }
+ include 'conditional_fatal-2.inc';
}
echo 'Bad', "\n";
--- /dev/null
+<?hh
+
+class A {}
+$x = 1;
--- /dev/null
+<?hh
+
+interface A {}
+$x = 1;
--- /dev/null
+<?hh
+
+trait T1 {
+ require extends A;
+}
+$x = 1;
--- /dev/null
+<?hh
+
+trait T2 {
+ require implements A;
+}
+$x = 1;
--- /dev/null
+<?hh
+
+class X {
+ use T1, T2;
+}
+$x = 1;
-<?hh
-
-
-<<__EntryPoint>>
-function main_duplicate_require2() {
-$n = apc_fetch('foo');
-if (!$n) $n = 0;
-apc_store('foo', ++$n);
-
-echo "Iteration: $n\n";
-
-if ($n == 1) {
- class A {}
-} else if ($n == 2) {
- interface A {}
-}
-
-if ($n & 1) {
- trait T1 {
- require extends A;
- }
-}
-
-if ($n & 2) {
- trait T2 {
- require implements A;
- }
-}
-
-if ($n == 3) {
- class X {
- use T1, T2;
- }
-}
-}
+<?hh
+
+<<__EntryPoint>>
+function main_duplicate_require2() {
+ $n = apc_fetch('foo');
+ if (!$n) $n = 0;
+ apc_store('foo', ++$n);
+
+ echo "Iteration: $n\n";
+
+ if ($n == 1) {
+ include 'duplicate_require2-1.inc';
+ } else if ($n == 2) {
+ include 'duplicate_require2-2.inc';
+ }
+
+ if ($n & 1) {
+ include 'duplicate_require2-3.inc';
+ }
+
+ if ($n & 2) {
+ include 'duplicate_require2-4.inc';
+ }
+
+ if ($n == 3) {
+ include 'duplicate_require2-5.inc';
+ }
+}
@@ -2,4 +2,4 @@ Iteration: 1
Iteration: 2
Iteration: 3
-Fatal error: Conflicting requirements for 'A'%sin %s/test/slow/traits/duplicate_require2.php on line %d
+Fatal error: Conflicting requirements for 'A' in %s on line %d
--- /dev/null
+<?php
+
+trait T {}
+$x = 1;
<?php
if (isset($g)) {
- trait T {}
+ include 'fatal_missing_trait.inc';
}
class C {
use T;
}
-function main() {
- var_dump(new C);
-}
-
-main();
+var_dump(new C());
--- /dev/null
+<?hh
+
+class B {}
+$x = 1;
--- /dev/null
+<?hh
+
+class B {
+ protected function foo() { echo "hi from foo\n"; }
+}
+$x = 1;
<?hh
if (getenv("NOFOO")) {
- class B {}
+ include 'non-unique-base-1.inc';
} else {
- class B {
- protected function foo() { echo "hi from foo\n"; }
- }
+ include 'non-unique-base-2.inc';
}
trait T {
--- /dev/null
+<?hh
+
+interface I2 {
+ require implements I1;
+}
+$x = 1;
@@ -6,9 +6,7 @@ interface I1 {}
<<__EntryPoint>>
function main_require_constraint_iface_implements_error() {
if (time() > 0) {
- interface I2 {
- require implements I1;
- }
+ include 'require_constraint_iface_implements_error.inc';
}
echo 'Fail';
-Fatal error: Only traits may use 'require implements'. in %s/test/slow/traits/require_constraint_iface_implements_error.php on line 10
\ No newline at end of file
+Fatal error: Only traits may use 'require implements'. in %s on line 4
--- /dev/null
+<?php
+
+class X {
+ public function f() {
+ var_dump('X1::f');
+ }
+}
+$x = 1;
--- /dev/null
+<?php
+
+class X {
+ public function f() {
+ var_dump('X2::f');
+ }
+}
+$x = 1;
@@ -9,18 +9,9 @@ function get() {
return true;
}
if (get()) {
- class X {
- public function f() {
- var_dump('X1::f');
- }
- }
-}
- else {
- class X {
- public function f() {
- var_dump('X2::f');
- }
- }
+ include '1860-1.inc';
+} else {
+ include '1860-2.inc';
}
class Y extends X {
}
--- /dev/null
+<?php
+
+class C1 extends B1 {
+ public $c1prop;
+ function c1method() {
+ return 2;
+ }
+}
+$x = 1;
--- /dev/null
+<?php
+
+class C1 extends B1 {
+ public $c1prop;
+ function c1method() {
+ return 2;
+ }
+}
+$x = 1;
@@ -56,20 +56,9 @@ class B1 extends A1 {
}
}
if (rand(0, 1)) {
- class C1 extends B1 {
- public $c1prop;
- function c1method() {
- return 2;
- }
- }
-}
- else {
- class C1 extends B1 {
- public $c1prop;
- function c1method() {
- return 2;
- }
- }
+ include '1862-1.inc';
+} else {
+ include '1862-2.inc';
}
class D1 extends C1 {
public $d1prop;
--- /dev/null
+<?hh
+
+class NotAnObject {
+ const FOO = 2;
+}
+$x = 1;
@@ -5,9 +5,7 @@ function a() {
}
function b() {
- class NotAnObject {
- const FOO = 2;
- }
+ include 'enum-param-2.inc';
}
function test2(NotAnObject $o) {
+++ /dev/null
-<?php
-
-// redec class gen
-function get() {
- return true;
- }
-
-// derive from redec gen
-class Foo {
- public function fooMsg() {
- return 'foo';
- }
- public function fooGen() {
- yield $this->fooMsg();
- }
-}
-
-// conditional derive from redec gen
-function get0() {
- return false;
- }
-function f($x) {
- if ($x) {
- if (get0()) {
- class X1 {
- public function msg() {
- return 'first, first';
- }
- public function gen() {
- yield $this->msg();
- }
- }
-
- }
- else {
- class X1 {
- public function msg() {
- return 'first, second';
- }
- public function gen() {
- yield $this->msg();
- }
- }
-
- }
-
- }
- else {
- if (get()) {
- class Y extends X1 {
- public function msg() {
- return 'second, first';
- }
- public function gen() {
- yield $this->msg();
- }
- }
-
- }
- else {
- class Y extends X1 {
- public function msg() {
- return 'second, second';
- }
- public function gen() {
- yield $this->msg();
- }
- }
-
- }
-
- }
- $x = $x ? new X1 : new Y;
- foreach ($x->gen() as $foo) {
- var_dump($foo);
- }
-}
-
-<<__EntryPoint>>
-function main_2165() {
-if (get()) {
- class X {
-
- public function yielder() {
- yield 'first';
- }
- }
-}
- else {
- class X {
-
- public function yielder() {
- yield 'second';
- }
- }
-}
-$x = new X;
-foreach ($x->yielder() as $foo) {
- var_dump($foo);
- }
-if (get()) {
- class Bar extends Foo {
- public function fooMsg() {
- return 'bar';
- }
- public function barMsg() {
- return 'bar';
- }
- public function barGen() {
- yield $this->barMsg();
- }
- }
-}
- else {
- class Bar extends Foo {
-}
-}
-$f = new Foo;
-foreach ($f->fooGen() as $foo) {
- var_dump($foo);
- }
-$b = new Bar;
-foreach ($b->fooGen() as $foo) {
- var_dump($foo);
- }
-foreach ($b->barGen() as $foo) {
- var_dump($foo);
- }
-f(true);
-f(false);
-}
+++ /dev/null
-string(5) "first"
-string(3) "foo"
-string(3) "bar"
-string(3) "bar"
-string(13) "first, second"
-string(13) "second, first"
+++ /dev/null
--vEnableHipHopSyntax=1 -d hhvm.php7.all=0 -d hhvm.php7.all=0
--vEval.EnablePHP=1
+++ /dev/null
-../hiphop.opts
\ No newline at end of file
--- /dev/null
+<?php
+
+class Y {}
+$x = 1;
--- /dev/null
+<?php
+
+class Y extends X {}
+$x = 1;
class X {
private $a = array(1,2,3);
function foo() {
- yield $this->a;
- }
+ yield $this->a;
+ }
}
if (isset($g)) {
- class Y {
-}
-}
- else {
- class Y extends X {
-}
-}
-class Z extends Y {
+ include '2182-1.inc';
+} else {
+ include '2182-2.inc';
}
+class Z extends Y {}
function test() {
$z = new Z;
foreach ($z->foo() as $v) {
--- /dev/null
+<?php
+
+class a {}
+$x = 1;
$i = 0;
function __autoload($k) {
if ($GLOBALS['i'] == 0) {
- class a {}
+ include 'class_alias2.inc';
}
++$GLOBALS['i'];
}