Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot append reference to bson #182

Closed
Martin1994 opened this issue Dec 23, 2015 · 1 comment
Closed

Cannot append reference to bson #182

Martin1994 opened this issue Dec 23, 2015 · 1 comment

Comments

@Martin1994
Copy link

My environment:

  • Win 10
  • IIS 10
  • PHP 7.0.0 NTS x64 / PHP 5.5.20 TS x64 with FastCGI
  • mongodb 3.2.0
  • mongodb (php driver) 1.1.1

I failed to write associative array with reference value to db.

The following codes should reproduce this issue:

$some_field = array();

$data = array(
    'some_field' => &$some_field
);

$bulk = new BulkWrite();
$bulk->insert($data);

The exception message is:
PHP Fatal error: Uncaught MongoDB\Driver\Exception\UnexpectedValueException: Got unsupported type 10 'unknown'
Type 10 is IS_REFERENCE defined in zend_types.h

It works after removing the & operator in line 3.

@jmikola
Copy link
Member

jmikola commented Dec 30, 2015

Tracking in PHPC-528. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants