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