Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getElementsByTagName() does not return array #38

Open
MaximMoinat opened this issue Dec 27, 2016 · 1 comment
Open

getElementsByTagName() does not return array #38

MaximMoinat opened this issue Dec 27, 2016 · 1 comment

Comments

@MaximMoinat
Copy link

If you try to get all the anchors like this, then by default one (the last) element is returned:
$anchors = $soup->getElementsByTagName('a');
The following does give me all the elements:
$anchors = $soup->getElementsByTagName('a', null);

The idx value defaults to -1. Is this on purpose?

@sunra
Copy link
Owner

sunra commented Dec 28, 2016

@MaximMoinat I think it is old php versions legacy. It in no particular purpose now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants