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

BSON classes should not assign public properties after var_dump()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.8
    • Fix Version/s: 1.3.0-beta1, 1.3.0
    • Labels:
      None

      Description

      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
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmikola Jeremy Mikola
              Reporter:
              derick Derick Rethans
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: