@@ -21,7 +21,7 @@ foreach ($tests as $test) {
2121 var_dump ($ object );
2222
2323 foreach ($ properties as $ property ) {
24- var_dump ( $ object->{ $ property} );
24+ printf ( " %s::$%s exists: %s \n" , get_class ( $ object), $ property, property_exists ( $ object , $ property ) ? ' yes ' : ' no ' );
2525 }
2626
2727 echo "\n" ;
@@ -31,26 +31,21 @@ foreach ($tests as $test) {
3131===DONE===
3232<?php exit (0 ); ?>
3333--EXPECTF--
34+
3435object(MongoDB\BSON\Binary)#%d (%d) {
3536 ["data"]=>
3637 string(3) "foo"
3738 ["type"]=>
3839 int(0)
3940}
40-
41- Notice: Undefined property: MongoDB\BSON\Binary::$data in %s on line %d
42- NULL
43-
44- Notice: Undefined property: MongoDB\BSON\Binary::$type in %s on line %d
45- NULL
41+ MongoDB\BSON\Binary::$data exists: no
42+ MongoDB\BSON\Binary::$type exists: no
4643
4744object(MongoDB\BSON\Decimal128)#%d (%d) {
4845 ["dec"]=>
4946 string(4) "3.14"
5047}
51-
52- Notice: Undefined property: MongoDB\BSON\Decimal128::$dec in %s on line %d
53- NULL
48+ MongoDB\BSON\Decimal128::$dec exists: no
5449
5550object(MongoDB\BSON\Javascript)#%d (%d) {
5651 ["code"]=>
@@ -61,12 +56,8 @@ object(MongoDB\BSON\Javascript)#%d (%d) {
6156 int(42)
6257 }
6358}
64-
65- Notice: Undefined property: MongoDB\BSON\Javascript::$code in %s on line %d
66- NULL
67-
68- Notice: Undefined property: MongoDB\BSON\Javascript::$scope in %s on line %d
69- NULL
59+ MongoDB\BSON\Javascript::$code exists: no
60+ MongoDB\BSON\Javascript::$scope exists: no
7061
7162object(MongoDB\BSON\MaxKey)#%d (%d) {
7263}
@@ -78,42 +69,30 @@ object(MongoDB\BSON\ObjectId)#%d (%d) {
7869 ["oid"]=>
7970 string(24) "%x"
8071}
81-
82- Notice: Undefined property: MongoDB\BSON\ObjectId::$oid in %s on line %d
83- NULL
72+ MongoDB\BSON\ObjectId::$oid exists: no
8473
8574object(MongoDB\BSON\Regex)#%d (%d) {
8675 ["pattern"]=>
8776 string(3) "foo"
8877 ["flags"]=>
8978 string(1) "i"
9079}
91-
92- Notice: Undefined property: MongoDB\BSON\Regex::$pattern in %s on line %d
93- NULL
94-
95- Notice: Undefined property: MongoDB\BSON\Regex::$flags in %s on line %d
96- NULL
80+ MongoDB\BSON\Regex::$pattern exists: no
81+ MongoDB\BSON\Regex::$flags exists: no
9782
9883object(MongoDB\BSON\Timestamp)#%d (%d) {
9984 ["increment"]=>
10085 string(4) "1234"
10186 ["timestamp"]=>
10287 string(4) "5678"
10388}
104-
105- Notice: Undefined property: MongoDB\BSON\Timestamp::$increment in %s on line %d
106- NULL
107-
108- Notice: Undefined property: MongoDB\BSON\Timestamp::$timestamp in %s on line %d
109- NULL
89+ MongoDB\BSON\Timestamp::$increment exists: no
90+ MongoDB\BSON\Timestamp::$timestamp exists: no
11091
11192object(MongoDB\BSON\UTCDateTime)#%d (%d) {
11293 ["milliseconds"]=>
11394 string(%d) "%d"
11495}
115-
116- Notice: Undefined property: MongoDB\BSON\UTCDateTime::$milliseconds in %s on line %d
117- NULL
96+ MongoDB\BSON\UTCDateTime::$milliseconds exists: no
11897
11998===DONE===
0 commit comments