I don’t think fixing Google’s index is enough and probably not you something we can rely on.(there are other search engines)
One problem could be that official PHP documentation only includes examples for using a specific function, not an entire use case from start to end. That would mean that examples would also include lots of HTML, CSS, SQL and JavaScript. But then of course it will no longer be a PHP documentation.
Writing correct up to date examples is very time consuming. Sites like w3schools tries to do this, w3schools was bad in the past but has become better, but it is also a commercial site so nothing you don’t want to contribute to with your own examples. At the same time it is understandable that w3schools wants something in return.
Another idea could be to contact site owners of these tutorials, but then they probably want the correct fix. This can also be time consuming.
Maybe an index of approved tutorials voted by the community and then make sure this index gets high on Google ranking.