Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
root
/
proc
/
thread-self
/
root
/
opt
/
php-8.2
/
share
/
test
/
mongodb
/
tests
/
bson
/
//proc/212/root/proc/thread-self/root/opt/php-8.2/share/test/mongodb/tests/bson/bson-toPHP-013.phpt
--TEST-- Uninstantiatable classes are ignored when processing __pclass --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; abstract class MyAbstractDocument implements MongoDB\BSON\Unserializable {} class MyDocument {} trait MyTrait {} $classes = [ 'MissingClass', MyAbstractDocument::class, MyDocument::class, MyTrait::class, MongoDB\BSON\Persistable::class, ]; foreach ($classes as $class) { var_dump(MongoDB\BSON\toPHP(MongoDB\BSON\fromJSON(sprintf('{"x": {"__pclass": {"$binary": "%s", "$type": "80"}, "y": 1}}', base64_encode($class))))); } ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- Deprecated: Function MongoDB\BSON\fromJSON() is deprecated in %s Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s object(stdClass)#%d (%d) { ["x"]=> object(stdClass)#%d (%d) { ["__pclass"]=> object(MongoDB\BSON\Binary)#%d (%d) { ["data"]=> string(12) "MissingClass" ["type"]=> int(128) } ["y"]=> int(1) } } Deprecated: Function MongoDB\BSON\fromJSON() is deprecated in %s Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s object(stdClass)#%d (%d) { ["x"]=> object(stdClass)#%d (%d) { ["__pclass"]=> object(MongoDB\BSON\Binary)#%d (%d) { ["data"]=> string(18) "MyAbstractDocument" ["type"]=> int(128) } ["y"]=> int(1) } } Deprecated: Function MongoDB\BSON\fromJSON() is deprecated in %s Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s object(stdClass)#%d (%d) { ["x"]=> object(stdClass)#%d (%d) { ["__pclass"]=> object(MongoDB\BSON\Binary)#%d (%d) { ["data"]=> string(10) "MyDocument" ["type"]=> int(128) } ["y"]=> int(1) } } Deprecated: Function MongoDB\BSON\fromJSON() is deprecated in %s Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s object(stdClass)#%d (%d) { ["x"]=> object(stdClass)#%d (%d) { ["__pclass"]=> object(MongoDB\BSON\Binary)#%d (%d) { ["data"]=> string(7) "MyTrait" ["type"]=> int(128) } ["y"]=> int(1) } } Deprecated: Function MongoDB\BSON\fromJSON() is deprecated in %s Deprecated: Function MongoDB\BSON\toPHP() is deprecated in %s object(stdClass)#%d (%d) { ["x"]=> object(stdClass)#%d (%d) { ["__pclass"]=> object(MongoDB\BSON\Binary)#%d (%d) { ["data"]=> string(24) "MongoDB\BSON\Persistable" ["type"]=> int(128) } ["y"]=> int(1) } } ===DONE===