Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

"resource" is a soft reserved word in PHP 7 #966

Closed
joshuanoyes opened this issue Jan 22, 2018 · 3 comments
Closed

"resource" is a soft reserved word in PHP 7 #966

joshuanoyes opened this issue Jan 22, 2018 · 3 comments

Comments

@joshuanoyes
Copy link

I suspect this is already on the radar and is not a high priority issue, but just in case it's been overlooked: resource is a soft reserved word since PHP 7, so it has the potential to cause problems with Illuminate\Http\Resources\Json\Resource if the word does become reserved in the future.

From http://php.net/manual/en/reserved.other-reserved-words.php

Whilst they may still be used as class, interface, and trait names (as well as in namespaces), usage of them is highly discouraged since they may be used in future versions of PHP.

Also see https://wiki.php.net/rfc/reserve_even_more_types_in_php_7

@mfn
Copy link

mfn commented Jan 22, 2018

Good catch!

@laurencei
Copy link

@joshuanoyes - thanks for raising the issue! Good pickup.

I've done a PR for this here: laravel/framework#22969

It'll be up to Taylor if it gets merged or not.

@joshuanoyes
Copy link
Author

@laurencei Happy to help! Thanks for the PR.

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

No branches or pull requests

3 participants