go to bug id or search bugs for
mysqli_fetch_object calls __set after calling the object constructor now.
In 5.6.20 and below the behaviour was the opposite, same with PDO and the old mysql extension.
I think the commit that makes this change is this one:
Add a Patch
Add a Pull Request
Same issue on PHP 7.0.6.
In PHP.net documentation http://php.net/manual/en/mysqli-result.fetch-object.php
Says "Note that mysqli_fetch_object() sets the properties of the object before calling the object constructor."
So yes this is a bug :(
This affects both 5.6.21 and 7.0.6 as well.
Thanks for the ping. These changes was reverted in the dev branch in 1cc536af5a9790288ef6638e3b167858d3b0cca1 and fc2a45b70a6675cad627cfe6341dc77d61952ba4. With this, the patches to bug #71820 are reverted.
See also bug #50636 and bug #49521 for the historical reasons. The change didn't cause any issues with the QA, thus it were released. The behavior is inconsistent, however it is documented this way. Thus reverted to avoid beyond breakage.
Also, please check the upcoming RC this week and ping back in case of issue.
Related To: Bug #72184
What about implementing something like PDO::FETCH_PROPS_LATE but for MySQLi and pg?
@mauroasprea, sounds sane to me, however i don't see where to pass this option to pg_fetch_object. Might be solvable anyway. Could you please open a FR for this, so the idea doesn't get forgotten?