Github - link to function in source

I know I can have anchors to a certain line, but if the source changes that line might become irrelevant. Example:

...source.php#L33 < line 33 may become line 40 later :(

Is there some way to tell GitHub to link to a certain function or property from the source, without specifying the line?

(The source is written in PHP code.)


AFAIK, no, but you can link to a certain revision of the file, and thus, you can know for sure that line will always point at the start of the function.

The URL looks like /{user}/{repo}/blob/{hash}/{file}#L{line}

To get it, click "Commits", select the last commit, click "Browse code", and find your file and line as usual.

documentation