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

BSON encoding unsupoprted types (Resource) should fail

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.5.1
    • Affects Version/s: 0.5.0
    • Component/s: None
    • None

      <?php
      $a = array(fopen("README.md", "a+"));
      $b = BSON\fromArray($a);
      var_dump($a, $b);
      ?>
      
      I DON'T SUPPORT THAT TYPE!
      array(1) {
        [0]=>
        resource(5) of type (stream)
      }
      string(5) ""
      

      The old driver used to silently ignore this - but I imagine we'd want to throw an exception since it is very unexpected value and sign of bad user error.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: