1--TEST-- 2ReflectionClass::getConstant() - bad params 3--FILE-- 4<?php 5class C { 6 const myConst = 1; 7} 8 9$rc = new ReflectionClass("C"); 10echo "Check invalid params:\n"; 11var_dump($rc->getConstant()); 12var_dump($rc->getConstant("myConst", "myConst")); 13var_dump($rc->getConstant(null)); 14var_dump($rc->getConstant(1)); 15var_dump($rc->getConstant(1.5)); 16var_dump($rc->getConstant(true)); 17var_dump($rc->getConstant(array(1,2,3))); 18var_dump($rc->getConstant(new C)); 19?> 20--EXPECTF-- 21Check invalid params: 22 23Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 0 given in %s on line 8 24NULL 25 26Warning: ReflectionClass::getConstant() expects exactly 1 parameter, 2 given in %s on line 9 27NULL 28bool(false) 29bool(false) 30bool(false) 31bool(false) 32 33Warning: ReflectionClass::getConstant() expects parameter 1 to be string, array given in %s on line 14 34NULL 35 36Warning: ReflectionClass::getConstant() expects parameter 1 to be string, object given in %s on line 15 37NULL 38