File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / reflection / tests / ReflectionParameter_DefaultValueConstant_basic2.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:00 2013 UTC (11 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace
--FILE--
<?php

namespace ReflectionTestNamespace {
	CONST TEST_CONST_1 = "Test Const 1";

	class TestClass {
		const TEST_CONST_2 = "Test Const 2 in class";
	}
}

namespace {
	function ReflectionParameterTest($test=ReflectionTestNamespace\TestClass::TEST_CONST_2, $test2 = ReflectionTestNamespace\CONST_TEST_1) {
		echo $test;
	}
	$reflect = new ReflectionFunction('ReflectionParameterTest');
	foreach($reflect->getParameters() as $param) {
		if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
			echo $param->getDefaultValueConstantName() . "\n";
		}
	}
	echo "==DONE==";
}
?>
--EXPECT--
ReflectionTestNamespace\TestClass::TEST_CONST_2
ReflectionTestNamespace\CONST_TEST_1
==DONE==

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>