1--TEST--
2ReflectionClass::setStaticPropertyValue() - bad params
3--CREDITS--
4Robin Fernandes <robinf@php.net>
5Steve Seear <stevseea@php.net>
6--FILE--
7<?php
8class C {
9    public static $x;
10}
11
12$rc = new ReflectionClass('C');
13try {
14    var_dump($rc->setStaticPropertyValue("x", "default value", 'blah'));
15} catch (TypeError $e) {
16    echo $e->getMessage() . "\n";
17}
18try {
19    var_dump($rc->setStaticPropertyValue());
20} catch (TypeError $e) {
21    echo $e->getMessage() . "\n";
22}
23try {
24    var_dump($rc->setStaticPropertyValue(null));
25} catch (TypeError $e) {
26    echo $e->getMessage() . "\n";
27}
28try {
29    var_dump($rc->setStaticPropertyValue(null,null));
30} catch (Exception $e) {
31    echo $e->getMessage() . "\n";
32}
33try {
34    var_dump($rc->setStaticPropertyValue(1.5, 'def'));
35} catch (Exception $e) {
36    echo $e->getMessage() . "\n";
37}
38try {
39    var_dump($rc->setStaticPropertyValue(array(1,2,3), 'blah'));
40} catch (TypeError $e) {
41    echo $e->getMessage() . "\n";
42}
43
44
45?>
46--EXPECTF--
47ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given
48ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given
49ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given
50
51Deprecated: ReflectionClass::setStaticPropertyValue(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d
52Class C does not have a property named
53Class C does not have a property named 1.5
54ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given
55