Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-528

Cannot append reference to BSON

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

      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:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: