Skip to content

Commit ff95a35

Browse files
committed
ext/standard/var.c: show unset properties
1 parent b160bbe commit ff95a35

31 files changed

+162
-73
lines changed

Zend/tests/019.phpt

+10-2
Original file line numberDiff line numberDiff line change
@@ -1237,15 +1237,23 @@ object(Point)#%d (3) {
12371237
["lable"]=>
12381238
string(6) "Point1"
12391239
}
1240-
object(Point)#%d (2) {
1240+
object(Point)#%d (3) {
1241+
["x"]=>
1242+
unset
12411243
["y"]=>
12421244
int(40)
12431245
["lable"]=>
12441246
string(6) "Point1"
12451247
}
12461248
bool(false)
12471249
bool(true)
1248-
object(Point)#%d (0) {
1250+
object(Point)#%d (3) {
1251+
["x"]=>
1252+
unset
1253+
["y"]=>
1254+
unset
1255+
["lable"]=>
1256+
unset
12491257
}
12501258
bool(true)
12511259
bool(false)

Zend/tests/ctor_promotion_untyped_default.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var_dump(new B);
2121

2222
?>
2323
--EXPECT--
24-
object(B)#1 (1) {
24+
object(B)#1 (2) {
2525
["untyped"]=>
2626
NULL
2727
["typed"]=>

Zend/tests/type_declarations/typed_properties_037.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $foo = new class {
99
var_dump($foo);
1010
?>
1111
--EXPECTF--
12-
object(class@anonymous)#%d (1) {
12+
object(class@anonymous)#%d (2) {
1313
["bar"]=>
1414
int(10)
1515
["qux"]=>

Zend/tests/type_declarations/typed_properties_052.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $obj = new A;
1818
var_dump($obj);
1919
?>
2020
--EXPECT--
21-
object(A)#1 (0) {
21+
object(A)#1 (6) {
2222
["a1"]=>
2323
uninitialized(A)
2424
["b1"]=>

Zend/tests/type_declarations/typed_properties_059.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ $x = new A;
1717
var_dump($x);
1818
?>
1919
--EXPECT--
20-
object(A)#1 (0) {
20+
object(A)#1 (4) {
2121
["a2"]=>
2222
uninitialized(int)
2323
["b2"]=>

Zend/tests/type_declarations/typed_properties_072.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var_dump($test->val);
1818

1919
?>
2020
--EXPECT--
21-
object(Test)#1 (0) {
21+
object(Test)#1 (1) {
2222
["val"]=>
2323
uninitialized(int)
2424
}

Zend/tests/type_declarations/typed_properties_073.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ var_dump($test, $val);
2323

2424
?>
2525
--EXPECT--
26-
object(Test)#1 (1) {
26+
object(Test)#1 (2) {
2727
["prop"]=>
2828
string(2) "42"
2929
["val"]=>
3030
uninitialized(int)
3131
}
3232
int(42)
33-
object(Test)#1 (1) {
33+
object(Test)#1 (2) {
3434
["prop"]=>
3535
&int(42)
3636
["val"]=>
3737
uninitialized(int)
3838
}
39-
object(Test)#1 (1) {
39+
object(Test)#1 (2) {
4040
["prop"]=>
4141
&string(1) "x"
4242
["val"]=>

Zend/tests/type_declarations/typed_properties_074.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ var_dump($test->prop);
2626

2727
?>
2828
--EXPECT--
29-
object(Test)#1 (1) {
29+
object(Test)#1 (2) {
3030
["prop"]=>
3131
&string(1) "x"
3232
["val"]=>
3333
uninitialized(int)
3434
}
3535
Value of type string returned from Test::__get() must be compatible with unset property Test::$val of type int
36-
object(Test)#1 (1) {
36+
object(Test)#1 (2) {
3737
["prop"]=>
3838
&string(1) "x"
3939
["val"]=>

Zend/tests/type_declarations/typed_properties_086.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var_dump($t);
2020

2121
?>
2222
--EXPECT--
23-
object(T)#1 (1) {
23+
object(T)#1 (2) {
2424
["i"]=>
2525
uninitialized(int)
2626
["1"]=>

Zend/tests/type_declarations/typed_properties_093.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var_dump($test);
2525
?>
2626
--EXPECT--
2727
Cannot assign string to property Test::$prop of type int
28-
object(Test)#2 (0) {
28+
object(Test)#2 (1) {
2929
["prop"]=>
3030
uninitialized(int)
3131
}

Zend/tests/type_declarations/typed_properties_095.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var_dump(_ZendTestClass::$staticIntProp);
6363
int(123)
6464
Cannot assign string to property _ZendTestClass::$intProp of type int
6565
Cannot assign _ZendTestClass to property _ZendTestClass::$classProp of type ?stdClass
66-
object(_ZendTestClass)#1 (3) {
66+
object(_ZendTestClass)#1 (6) {
6767
["intProp"]=>
6868
int(456)
6969
["classProp"]=>
@@ -81,7 +81,7 @@ object(_ZendTestClass)#1 (3) {
8181
int(123)
8282
Cannot assign string to property _ZendTestClass::$intProp of type int
8383
Cannot assign Test to property _ZendTestClass::$classProp of type ?stdClass
84-
object(Test)#4 (3) {
84+
object(Test)#4 (6) {
8585
["intProp"]=>
8686
int(456)
8787
["classProp"]=>

Zend/tests/type_declarations/typed_properties_096.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var_dump($test);
3232
?>
3333
--EXPECT--
3434
Cannot assign int to property Test1::$prop of type Foobar
35-
object(Test1)#1 (1) {
35+
object(Test1)#1 (2) {
3636
["prop"]=>
3737
uninitialized(Foobar)
3838
["prop2"]=>

Zend/tests/type_declarations/typed_properties_101.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ $test->dump();
1919

2020
?>
2121
--EXPECTF--
22-
object(Test)#1 (0) {
22+
object(Test)#1 (3) {
2323
["public"]=>
2424
uninitialized(bool)
2525
["protected":protected]=>
2626
uninitialized(float)
2727
["private":"Test":private]=>
2828
uninitialized(string)
2929
}
30-
object(Test)#1 (0) refcount(%d){
30+
object(Test)#1 (3) refcount(%d){
3131
["public"]=>
3232
uninitialized(bool)
3333
["protected":protected]=>

Zend/tests/type_declarations/union_types/internal_trait_use_typed_union.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var_dump($types, (string)$types[0], (string)$types[1]);
2020
?>
2121
===DONE===
2222
--EXPECT--
23-
object(C)#1 (1) {
23+
object(C)#1 (2) {
2424
["testProp"]=>
2525
NULL
2626
["classUnionProp"]=>

Zend/tests/unset_prop_recursion.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ object(Node)#2 (2) {
4848
object(Node)#1 (2) {
4949
["parent"]=>
5050
NULL
51+
["children"]=>
52+
unset
5153
}
5254
["children"]=>
5355
array(0) {
@@ -58,6 +60,8 @@ object(Node)#3 (2) {
5860
object(Node)#1 (2) {
5961
["parent"]=>
6062
NULL
63+
["children"]=>
64+
unset
6165
}
6266
["children"]=>
6367
array(0) {

ext/pdo/tests/pdo_036.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var_dump($x);
2626

2727
?>
2828
--EXPECTF--
29-
object(PDOStatement)#%d (0) {
29+
object(PDOStatement)#%d (1) {
3030
["queryString"]=>
3131
uninitialized(string)
3232
}

ext/spl/tests/arrayObject___construct_basic2.phpt

+15-7
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,30 @@ NULL
5555
string(12) "C::prop.orig"
5656
- Write:
5757

58-
Deprecated: Creation of dynamic property ArrayObject::$prop is deprecated in %s on line %d
58+
Deprecated: Creation of dynamic property ArrayObject::$prop is deprecated in /home/girgias/Dev/php-src/ext/spl/tests/arrayObject___construct_basic2.php on line 30
5959
string(8) "changed1"
6060
string(8) "changed2"
6161
- Isset:
6262
bool(true)
6363
bool(true)
6464
- Unset:
6565

66-
Warning: Undefined property: ArrayObject::$prop in %s on line %d
66+
Warning: Undefined property: ArrayObject::$prop in /home/girgias/Dev/php-src/ext/spl/tests/arrayObject___construct_basic2.php on line 40
6767

68-
Warning: Undefined array key "prop" in %s on line %d
68+
Warning: Undefined array key "prop" in /home/girgias/Dev/php-src/ext/spl/tests/arrayObject___construct_basic2.php on line 40
6969
NULL
7070
NULL
7171
- After:
7272
object(ArrayObject)#2 (1) {
7373
["storage":"ArrayObject":private]=>
74-
object(C)#1 (0) {
74+
object(C)#1 (1) {
75+
["prop"]=>
76+
unset
7577
}
7678
}
77-
object(C)#1 (0) {
79+
object(C)#1 (1) {
80+
["prop"]=>
81+
unset
7882
}
7983

8084
--> Access prop on instance of MyArrayObject:
@@ -99,8 +103,12 @@ NULL
99103
- After:
100104
object(MyArrayObject)#3 (1) {
101105
["storage":"ArrayObject":private]=>
102-
object(C)#4 (0) {
106+
object(C)#4 (1) {
107+
["prop"]=>
108+
unset
103109
}
104110
}
105-
object(C)#4 (0) {
111+
object(C)#4 (1) {
112+
["prop"]=>
113+
unset
106114
}

ext/spl/tests/arrayObject___construct_basic3.phpt

+12-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ NULL
7171
- After:
7272
object(ArrayObject)#2 (1) {
7373
["storage":"ArrayObject":private]=>
74-
object(C)#1 (0) {
74+
object(C)#1 (1) {
75+
["prop"]=>
76+
unset
7577
}
7678
}
77-
object(C)#1 (0) {
79+
object(C)#1 (1) {
80+
["prop"]=>
81+
unset
7882
}
7983

8084
--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST:
@@ -99,8 +103,12 @@ NULL
99103
- After:
100104
object(MyArrayObject)#3 (1) {
101105
["storage":"ArrayObject":private]=>
102-
object(C)#4 (0) {
106+
object(C)#4 (1) {
107+
["prop"]=>
108+
unset
103109
}
104110
}
105-
object(C)#4 (0) {
111+
object(C)#4 (1) {
112+
["prop"]=>
113+
unset
106114
}

ext/spl/tests/arrayObject___construct_basic4.phpt

+12-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ NULL
6969
- After:
7070
object(ArrayObject)#2 (1) {
7171
["storage":"ArrayObject":private]=>
72-
object(C)#1 (0) {
72+
object(C)#1 (1) {
73+
["prop"]=>
74+
unset
7375
}
7476
}
75-
object(C)#1 (0) {
77+
object(C)#1 (1) {
78+
["prop"]=>
79+
unset
7680
}
7781

7882
--> Access prop on instance of MyArrayObject with ArrayObject::ARRAY_AS_PROPS:
@@ -97,8 +101,12 @@ NULL
97101
- After:
98102
object(MyArrayObject)#3 (1) {
99103
["storage":"ArrayObject":private]=>
100-
object(C)#4 (0) {
104+
object(C)#4 (1) {
105+
["prop"]=>
106+
unset
101107
}
102108
}
103-
object(C)#4 (0) {
109+
object(C)#4 (1) {
110+
["prop"]=>
111+
unset
104112
}

ext/spl/tests/arrayObject___construct_basic5.phpt

+12-4
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ NULL
6969
- After:
7070
object(ArrayObject)#2 (1) {
7171
["storage":"ArrayObject":private]=>
72-
object(C)#1 (0) {
72+
object(C)#1 (1) {
73+
["prop"]=>
74+
unset
7375
}
7476
}
75-
object(C)#1 (0) {
77+
object(C)#1 (1) {
78+
["prop"]=>
79+
unset
7680
}
7781

7882
--> Access prop on instance of MyArrayObject with ArrayObject::STD_PROP_LIST|ArrayObject::ARRAY_AS_PROPS:
@@ -97,8 +101,12 @@ NULL
97101
- After:
98102
object(MyArrayObject)#3 (1) {
99103
["storage":"ArrayObject":private]=>
100-
object(C)#4 (0) {
104+
object(C)#4 (1) {
105+
["prop"]=>
106+
unset
101107
}
102108
}
103-
object(C)#4 (0) {
109+
object(C)#4 (1) {
110+
["prop"]=>
111+
unset
104112
}

ext/spl/tests/arrayObject_magicMethods1.phpt

+6-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ object(ArrayObject)#2 (1) {
171171

172172
--> Unset existent, non-existent and dynamic:
173173
Original wrapped object:
174-
object(UsesMagic)#1 (3) {
174+
object(UsesMagic)#1 (4) {
175+
["a"]=>
176+
unset
175177
["b"]=>
176178
int(2)
177179
["c"]=>
@@ -182,7 +184,9 @@ object(UsesMagic)#1 (3) {
182184
Wrapping ArrayObject:
183185
object(ArrayObject)#2 (1) {
184186
["storage":"ArrayObject":private]=>
185-
object(UsesMagic)#1 (3) {
187+
object(UsesMagic)#1 (4) {
188+
["a"]=>
189+
unset
186190
["b"]=>
187191
int(2)
188192
["c"]=>

0 commit comments

Comments
 (0)