hoaproject/Ustring

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:

  1. create Hoa\Ustring,
  2. import Hoa\String into Hoa\Ustring and update the code, documentation, tests and README.md,
  3. rename the Git repository on git.hoa-project.net, github.com/hoaproject and pikacode.com/hoaproject from String.git to Ustring.git (this way we don't lost stargazers & co.),
  4. update Packagist to point to github.com/hoaproject/Ustring,
  5. update composer.json library's name to hoa/ustring (here, we will break stuff and lost Packagist numbers),
  6. update all dependencies on Hoa,
  7. update the website,
  8. create Hoa\String, extending Hoa\Ustring but deprecated,
  9. update Hoa\Core\Consistency::isKeyword (with other libraries, like Hoa\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

@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.

Jir4 commented

👍

11:12 @weltling Hywan, i haven't test the context sensitive lexer branch ... you could do a quick try and see if it's doing something, as that RFC targets 7.0 one
11:12 @weltling if it doesn't fix, probably won't fix at least in 7.0

… compiling :-).

Funny, during Phptour talk, a guy from SensioLabs talk about same problem for Symfony.
my thought going also for Ustring 👍

Hywan commented

todo list updated.

Hywan commented

Related to hoaproject/Core#80.