As you may or may not know, PHP7 (the next version of the language version PocketMine uses) is going to be released soon. This has been highly anticipated, as this update will bring huge performance improvements, and PocketMine will benefit of this greatly (expect at least two times as fast in the worst case!). It also adds new language features, which we will be using.

However, to fully use all the new features, we need to do partial backwards-incompatible changes to the plugin API, so the version will be bumped to 2.0.0. But wait! Don't start strong arguments yet. Why are we doing this? What is going to happen to existing plugins? Will I have to do something? Should I hate @shoghicp? Just read this big text so we can clarify all of that.

Why are we doing this?
PHP7 comes with a lot of new features and performance improvements. We would like to use all of the new features so the development process can be faster, have better code, and improve the overall performance besides the base enhancements.
We had two options, just update to PHP7 with the current code (which should work OOB) without using the new features, or use the new features. Unfortunately, using the new features means modifying the method signatures, so extending those classes with old code will break. The fix is simple and fast, nevertheless, it breaks plugins, so it requires bumping the major version to 2.
This is no big change as it was from the infamous "Old API" to the "New API" (current API, since 1.4), so you don't have to learn everything again.

Short version: PHP7 has new awesome stuff that requires modifying method signatures. This breaks backwards-compatibility for some plugins (with a simple and fast fix), so we are bumping the major version.

What is going to happen to existing plugins?
First, you should contact the developers of your plugins about this and link them here (or future information). I recommend the developers itself to inform their users of this change.
Second, and this will be mostly for developers, you will have to upgrade and change the target version.
If your plugin only calls methods and does basic stuff, you should be almost done after bumping the version. If you extend some class or implement an interface, it will be different. Starting on PHP7, scalar type hints can be added to your methods (not only class hints anymore!). On the PocketMine core, this was done before using Doc comments, but now we will do something like this:

As you can see, the changes will be minimal and you should just update your method signatures. We are also going to remove all the deprecated methods, classes, properties and other stuff. You can see them as they are marked with @deprecated. You don't have to learn everything from scratch, in fact, everything will be the same (but easier, as you can know what that argument is now!). More information will be available as we update the core to support everything.

Short version: Most of them will work without problems, others will have to do minor changes.

Will I have to do something?
If you use plugins: inform your plugin developers about this. Besides that, you will have to update to a new version of plugins as they are available.
If you develop plugins: see text above.

Should I hate @shoghicp?
Hmm, that's your decision. But you can blame me!

WHAT DO I NEED TO DO NOW?!?!
Nothing. For now, wait, more information will be available later (after we update the core), and this will start happening next month. Just wait patiently, and try to tell developers you know about this so they prepare for it (and learn the new awesome way to do it!)

I have a question. Why will we have to update our plugins? I realize that we need PHP7 to use scalar type hinting, but we can still do it the old way (without type hinting), and it would still be valid.

I have a question. Why will we have to update our plugins? I realize that we need PHP7 to use scalar type hinting, but we can still do it the old way (without type hinting), and it would still be valid.

Click to expand...

READ!

You don't need to add type-hints everywhere, just on the classes that extend from PocketMine. It is recommended, though, as you will get less undefined behavior and more performance.

As you may or may not know, PHP7 (the next version of the language version PocketMine uses) is going to be released soon. This has been highly anticipated, as this update will bring huge performance improvements, and PocketMine will benefit of this greatly (expect at least two times as fast in the worst case!). It also adds new language features, which we will be using.

However, to fully use all the new features, we need to do partial backwards-incompatible changes to the plugin API, so the version will be bumped to 2.0.0. But wait! Don't start strong arguments yet. Why are we doing this? What is going to happen to existing plugins? Will I have to do something? Should I hate @shoghicp? Just read this big text so we can clarify all of that.

Why are we doing this?
PHP7 comes with a lot of new features and performance improvements. We would like to use all of the new features so the development process can be faster, have better code, and improve the overall performance besides the base enhancements.
We had two options, just update to PHP7 with the current code (which should work OOB) without using the new features, or use the new features. Unfortunately, using the new features means modifying the method signatures, so extending those classes with old code will break. The fix is simple and fast, nevertheless, it breaks plugins, so it requires bumping the major version to 2.
This is no big change as it was from the infamous "Old API" to the "New API" (current API, since 1.4), so you don't have to learn everything again.

Short version: PHP7 has new awesome stuff that requires modifying method signatures. This breaks backwards-compatibility for some plugins (with a simple and fast fix), so we are bumping the major version.

What is going to happen to existing plugins?
First, you should contact the developers of your plugins about this and link them here (or future information). I recommend the developers itself to inform their users of this change.
Second, and this will be mostly for developers, you will have to upgrade and change the target version.
If your plugin only calls methods and does basic stuff, you should be almost done after bumping the version. If you extend some class or implement an interface, it will be different. Starting on PHP7, scalar type hints can be added to your methods (not only class hints anymore!). On the PocketMine core, this was done before using Doc comments, but now we will do something like this:

As you can see, the changes will be minimal and you should just update your method signatures. We are also going to remove all the deprecated methods, classes, properties and other stuff. You can see them as they are marked with @deprecated. You don't have to learn everything from scratch, in fact, everything will be the same (but easier, as you can know what that argument is now!). More information will be available as we update the core to support everything.

Short version: Most of them will work without problems, others will have to do minor changes.

Will I have to do something?
If you use plugins: inform your plugin developers about this. Besides that, you will have to update to a new version of plugins as they are available.
If you develop plugins: see text above.

Should I hate @shoghicp?
Hmm, that's your decision. But you can blame me!

WHAT DO I NEED TO DO NOW?!?!
Nothing. For now, wait, more information will be available later (after we update the core), and this will start happening next month. Just wait patiently, and try to tell developers you know about this so they prepare for it (and learn the new awesome way to do it!)

Click to expand...

Yay like all other programming languages! @shoghicp, will we be able to try PocketMine with PHP 7 before October?
Then why shouldn't we blame you?
You are working very hard. Lol I'm writing a server software for my game ( and obviously also the game) and I'm losing lot of time on finding bugs, adding new features...
You are working very hard on MCPE and PocketMine!!! Blame you

Yay like all other programming languages! @shoghicp, will we be able to try PocketMine with PHP 7 before October?
Then why shouldn't we blame you?
You are working very hard. Lol I'm writing a server software for my game ( and obviously also the game) and I'm losing lot of time on finding bugs, adding new features...
You are working very hard on MCPE and PocketMine!!! Blame you

@shoghicp since you're so worried that instanceof calls lag the server, remove all type hints!

Perfect solution for forum disputes:

Gulliver's Travels said:

You take a hundred leaders of each party; you dispose them into couples of such whose heads are nearest of a
size; then let two nice operators saw off the occiput of each couple at the same time, in such a manner that the brain may be equally divided. Let the occiputs, thus cut off, be interchanged, applying each to the head of his opposite party-man.

Click to expand...

Press the like button if I helped!I respect your freedom of speech, so don't click if you don't want to

Personally I feel like this decision has been made by @shoghicp personally, without proper discussion with any members of The PocketMine Team nor any proper discussion with any of the developers. A backwards incompatible change without an RFC? I don't see how strict types will be beneficial, maybe apart from the levels module. If anything, it will just add boilerplate casts everywhere - strict types are meant to be used sparingly, and at appropriate critical points. It really feels like strict type is being used just for the sake of using the new features in PHP7, but any experienced developers will know why jumping at an untested hype is a bad idea. But hey, convince me otherwise

Personally I feel like this decision has been made by @shoghicp personally, without proper discussion with any members of The PocketMine Team nor any proper discussion with any of the developers. A backwards incompatible change without an RFC? I don't see how strict types will be beneficial, maybe apart from the levels module. If anything, it will just add boilerplate casts everywhere - strict types are meant to be used sparingly, and at appropriate critical points. It really feels like strict type is being used just for the sake of using the new features in PHP7, but any experienced developers will know why jumping at an untested hype is a bad idea. But hey, convince me otherwise

Click to expand...

This was discussed on #pocketmine and #pocketmine-team before. Please check the logs before commenting

Personally I feel like this decision has been made by @shoghicp personally, without proper discussion with any members of The PocketMine Team nor any proper discussion with any of the developers. A backwards incompatible change without an RFC? I don't see how strict types will be beneficial, maybe apart from the levels module. If anything, it will just add boilerplate casts everywhere - strict types are meant to be used sparingly, and at appropriate critical points. It really feels like strict type is being used just for the sake of using the new features in PHP7, but any experienced developers will know why jumping at an untested hype is a bad idea. But hey, convince me otherwise

This was discussed on #pocketmine and #pocketmine-team before. Please check the logs before commenting

Click to expand...

So your discussion conclusion is that more instance checks is beneficial

Perfect solution for forum disputes:

Gulliver's Travels said:

You take a hundred leaders of each party; you dispose them into couples of such whose heads are nearest of a
size; then let two nice operators saw off the occiput of each couple at the same time, in such a manner that the brain may be equally divided. Let the occiputs, thus cut off, be interchanged, applying each to the head of his opposite party-man.

Click to expand...

Press the like button if I helped!I respect your freedom of speech, so don't click if you don't want to