Conflict with PHP7
Hywan opened this issue · 9 comments
Hello 😄,
PHP7 has a new keyword: string
. To bad for us, it makes Hoa\String
crashes because we can no longer use this keyword.
Here, we need to rename this library. I suggest Hoa\Ustring
, like ustring
(“unicode strings”). This would be pretty logical.
How to migrate then, without breaking code? It will break the code, for sure, but it will create a new library. Here is my proposal, probably not perfect, feel free to comment:
- create
Hoa\Ustring
, - import
Hoa\String
intoHoa\Ustring
and update the code, documentation, tests andREADME.md
, - rename the Git repository on git.hoa-project.net, github.com/hoaproject and pikacode.com/hoaproject from
String.git
toUstring.git
(this way we don't lost stargazers & co.), - update Packagist to point to github.com/hoaproject/Ustring,
- update
composer.json
library's name tohoa/ustring
(here, we will break stuff and lost Packagist numbers), - update all dependencies on Hoa,
- update the website,
- create
Hoa\String
, extendingHoa\Ustring
but deprecated, - update
Hoa\Core\Consistency::isKeyword
(with other libraries, likeHoa\Realdom
).
We could keep the String.git
repository for some time, I don't know. As far as I know, nobody requires hoa/string
directly, but only through others libraries.
Thoughts @hoaproject/hoackers?
To be frank, I thought https://wiki.php.net/rfc/context_sensitive_lexer would resolve the issue, but it lands in PHP7 and nothing is solved 😁.
I suggest to create Hoa\String and extend Hoa\Ustring to not break code for php < 7
See new reserved keywords: http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_compile.c#reserved_class_names (thanks @weltling for the link).
@marmotz Good idea! With a separate library, so. We could move Hoa\String
to Hoa\Ustring
and then create a new Hoa\String
library that extends Hoa\Ustring
, and require php: '< 7'
. It could work.
👍
Funny, during Phptour talk, a guy from SensioLabs talk about same problem for Symfony.
my thought going also for Ustring 👍
todo list updated.
Related to hoaproject/Core#80.