Cannot append reference to BSON

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.1.2
    • Affects Version/s: 1.1.1
    • Component/s: None
    • None
    • Environment:
      PHP 7
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      phongo_bson_append() throws an exception when encountering a zval reference. Code to reproduce:

      $some_field = array();
      
      $data = array(
          'some_field' => &$some_field
      );
      
      $bulk = new BulkWrite();
      $bulk->insert($data);
      

      The exception thrown is:

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

              Assignee:
              Jeremy Mikola
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: