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

Regression on master about SimpleXMLElement attributes #4984

Closed
orklah opened this issue Jan 11, 2021 · 1 comment
Closed

Regression on master about SimpleXMLElement attributes #4984

orklah opened this issue Jan 11, 2021 · 1 comment

Comments

@orklah
Copy link
Collaborator

orklah commented Jan 11, 2021

Psalm found a new false positive on my work project with last master.

I not sure since when the issue is there, it may be related to: #4934

https://psalm.dev/r/228ce9f5ad

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/228ce9f5ad
<?php

$xml = new SimpleXMLElement('');
$result = $xml->xpath('');
$result[0]->attributes()->id;
Psalm output (using commit 00f3ccb):

INFO: PossiblyUndefinedIntArrayOffset - 5:1 - Possibly undefined array offset 'int(0)' is risky given expected type 'array-key'. Consider using isset beforehand.

ERROR: UndefinedPropertyFetch - 5:1 - Instance property SimpleXMLIterator::$id is not defined

@orklah orklah closed this as completed Oct 12, 2021
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

1 participant