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

BSON classes should not assign public properties after var_dump()

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta1, 1.3.0
    • Affects Version/s: 1.2.8
    • Component/s: None
    • None

      Run:

      <?php
      error_reporting(-1);
      $a = new MongoDB\BSON\UTCDateTime();
      echo $a->milliseconds, "\n";
      
      var_dump( $a );
      echo $a->milliseconds, "\n";
      ?>
      

      This throws:

      Notice: Undefined property: MongoDB\BSON\UTCDateTime::$milliseconds in /tmp/m1.php on line 4
      
      Call Stack:
          0.0001     263184   1. {main}() /tmp/m1.php:0
      
      
      /tmp/m1.php:6:
      class MongoDB\BSON\UTCDateTime#1 (1) {
        public $milliseconds =>
        string(13) "1490279668697"
      }
      1490279668697
      

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            derick Derick Rethans
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: