Inexact Code Example with Comparing Objects
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
From manual page: https://php.net/language.oop5.object-comparison
The code example on the mentioned page seems problematic.
function compareObjects(&$o1, &$o2) {...}
I am not sure what the original intention was to pass the variables by reference, but this is unnecessary, as the variables would point to the same object instances anyway, no matter if the variables themselves are references or not. The creation of references could lead to some confusion (it did for me), as to why this is done like this.
It might also be a consideration to avoid speaking of the two variables as references, as they are no aliases, just point to the same object instance:
echo "\nTwo references to the same instance\n";
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the object-comparison manual page linked in the issue and review the compareObjects example and its explanatory text. Update the example and wording to match the issue's requested clarification, then verify that the page accurately describes comparing object instances.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100