summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug38653.phpt
blob: 68781d2aba1e1141cf64aa78e2134e571922a377 (plain)
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
--TEST--
Bug #38653 (memory leak in ReflectionClass::getConstant())
--FILE--
<?php

class foo {
	    const cons = 10;
	    const cons1 = "";
	    const cons2 = "test";
}

class bar extends foo {
}

$foo = new ReflectionClass("foo");
var_dump($foo->getConstant("cons"));
var_dump($foo->getConstant("cons1"));
var_dump($foo->getConstant("cons2"));
var_dump($foo->getConstant("no such const"));

echo "Done\n";
?>
--EXPECTF--	
int(10)
string(0) ""
string(4) "test"
bool(false)
Done