Lines Matching refs:test
22 function invalid(Test $test, string $prop1, string $prop2, $value) {
24 $test->$prop2 = $value;
25 $test->$prop1 =& $test->$prop2;
29 $test->$prop1 = $value;
30 $test->$prop2 =& $test->$prop1;
35 function valid(Test $test, string $prop1, string $prop2, $value) {
37 $test->$prop2 = $value;
38 $test->$prop1 =& $test->$prop2;
43 $test->$prop1 = $value;
44 $test->$prop2 =& $test->$prop1;
50 $test = new Test;
51 invalid($test, 'int', 'float', 42.0);
52 valid($test, 'int', 'nint', 42);
53 invalid($test, 'int', 'nint', null);
54 valid($test, 'nint', 'nstring', null);
55 invalid($test, 'nint', 'nstring', '42');
56 valid($test, 'A', 'A', new A);
57 valid($test, 'A', 'B', new B);
58 invalid($test, 'A', 'B', new A);
59 valid($test, 'iterable', 'array', [1, 2, 3]);
60 valid($test, 'A', 'object', new A);
61 invalid($test, 'A', 'object', new Test);
62 valid($test, 'iterable', 'Iterator', new ArrayIterator);
63 invalid($test, 'Iterator', 'iterable', [1, 2, 3]);
64 valid($test, 'object', 'iterable', new ArrayIterator);
65 invalid($test, 'iterable', 'object', new stdClass);