runkit icon indicating copy to clipboard operation
runkit copied to clipboard

PHP7 support

Open RikudouSage opened this issue 9 years ago • 43 comments

Hello, is there a plan for php 7 support? I use your module and recently I installed php 7 so I can start testing my apps and I would really appreciate if you make a php 7 version :)

RikudouSage avatar Aug 27 '15 15:08 RikudouSage

Show me the money ;)

zenovich avatar Sep 05 '15 15:09 zenovich

Okay, I will donate you, if you make the php 7 version :)

RikudouSage avatar Sep 08 '15 08:09 RikudouSage

I forked the project to support a subset of runkit's functions for PHP7: https://github.com/runkit7/runkit7

EDIT: Current status can be seen at https://github.com/runkit7/runkit7#compatability-php70-to-php-72

  • This has been compiled in 64-bit builds of PHP on Linux EDIT: and 32-bit builds work equally well, as well as on windows.
  • ... and will run (downhill, downwind, in a hurricane). There are bugs related to segmentation faults and memory management. There are also bugs related to language features that have changed in PHP7. EDIT: Any segfaults were fixed, memory management is still not freed (to avoid crashes), but should be suitable for unit testing
  • 59/177 of runkit's tests are passing in the PHP7 fork
  • 32-bit builds haven't been tested, and probably aren't working yet.
  • The enabled runkit functions are
  • runkit_method_add
  • runkit_method_copy
  • runkit_method_redefine
  • runkit_method_remove
  • runkit_function_add
  • runkit_function_copy
  • runkit_function_remove, and
  • runkit_function_redefine.
  • EDIT: runkit_object_id was added
  • EDIT: runkit_import is in progress for a subset of flags, doesn't allow importing properties yet

Help is welcome from people with experience creating/maintaining/upgrading PHP extensions, or who are familiar with Zend internals.
:+1: on PHP7 support. I use runkit for unit testing, and want to test out a PHP5 project on PHP7.

EDIT: More tests are working, including some(but not all) of the tests of constants (Zend VM aggressively inlines constants within the same scope/file). I still don't have class manipulation, properties or import working, sadly. EDIT: tests are passing, except for some expected failures for constant manipulation (some inlined by Zend VM optimizations). property manipulation was disabled. EDIT: runkit_import has partial support, but doesn't support all of the flags EDIT: This now supports php 7.2 and 7.3alpha2 as well

TysonAndre avatar Sep 09 '15 07:09 TysonAndre

I don't like the idea of castrating Runkit for PHP7.

zenovich avatar Sep 09 '15 12:09 zenovich

Why castrating? PHP 5 will be a thing of past in few years, why do you think it's best idea to port it for PHP7?

RikudouSage avatar Sep 09 '15 12:09 RikudouSage

Now people use PHP 5 and there are no reasons to discard it. Anyway now I already have "Tests passed: 90" and I will not participate in @TysonAndre 's branch. Sorry.

zenovich avatar Sep 09 '15 13:09 zenovich

I'm okay with that, it's your choice, I just do not understand your point of view, that's all. Anyway, thanks for your work on this module, I use it in my project :)

RikudouSage avatar Sep 09 '15 14:09 RikudouSage

That's fine.

To clarify: you're developing a branch of runkit that works with the latest release candidate of PHP 7, and 90/177 tests are passing?

Also, which way do you plan to port runkit to PHP7?

  • A single branch that should compile with both PHP 7 and PHP <= 5.6?
  • A separate branch for PHP7?

TysonAndre avatar Sep 09 '15 16:09 TysonAndre

Yes, actually 97/175 with php7rc2, a single branch for all PHP versions.

zenovich avatar Sep 09 '15 16:09 zenovich

I do agree with @zenovich, it's better to keep every change to this repository in order to have a single runkit version compatible with both PHP 5 and PHP 7 because PHP 5 will be used for another decade.

tristanleboss avatar Oct 06 '15 22:10 tristanleboss

@tristanleboss I would agree with zenovich too, but he stated that he does not "like the idea of castrating Runkit for PHP7".

RikudouSage avatar Oct 08 '15 07:10 RikudouSage

@tristanleboss @RikudouSage To be fair, I think @TysonAndre 's intention was to simply get it working with PHP7 as a proof of concept, not to drop the support for good. If I were to try to do it myself, I'd probably figure it out how to make it work for PHP7 first and then bother with the older PHP versions. The intent would not be to "castrate" it.

mishan avatar Oct 08 '15 19:10 mishan

Sorry, guys, but Runkit that works only with PHP 7 x64 without importing, without constants and properties manipulations, and without classes adoption or emancipation was definitely castrated.

zenovich avatar Oct 08 '15 19:10 zenovich

@zenovich It wasn't the plan to leave it out, I think that was just testing around. At least that's how I would have approached it and that's how it looks to me.

EDiT: So, to clarify, I totally agree that it would be "castrating" it to remove older PHP and I am not disagreeing with you. I'm just pointing out that this was not actually intended as something that would be ever released.

mishan avatar Oct 08 '15 20:10 mishan

Again, I already know how to achieve the full support of PHP 7 compatibly with PHP 5, but it is big work and I'm sure this work should be paid for. Sponsors are welcomed to discuss this via email [email protected]

zenovich avatar Oct 08 '15 20:10 zenovich

@zenovich Well you are the guy to do it :) We've spoken over email already and what we've discussed still stands.

mishan avatar Oct 08 '15 21:10 mishan

Some news about support runkit on Php 7 ^^

duchnoun avatar Dec 28 '15 14:12 duchnoun

How much money? :smile:

taylorotwell avatar Mar 15 '16 19:03 taylorotwell

We can talk about this in person if you want to. My email is [email protected].

zenovich avatar Mar 15 '16 20:03 zenovich

@zenovich didn't you think about https://www.kickstarter.com/discover/categories/technology/software ? set some reasonable price and it will be faster I guess

digitalist avatar Jun 15 '16 19:06 digitalist

@digitalist I thought of different things, but I have no time to do them.

zenovich avatar Jun 16 '16 20:06 zenovich

Are there any news regarding php7 support? Runkit would fit perfectly for our use case but we use PHP 7 in development and also in production in a short time.

Can we start investing in runkit or should we find an alternative?

mircea-soaica avatar Oct 19 '16 09:10 mircea-soaica

I mentioned my unaffiliated runkit7 fork earlier.

See https://github.com/runkit7/runkit7#compatability-php70-partial-buggy and https://github.com/runkit7/runkit7#reasons-for-disabling-property-manipulation to see if that fits your use case.

TysonAndre avatar Oct 19 '16 16:10 TysonAndre

@TysonAndre I've seen your repo, but that is an incomplete implementation "Runkit that (mostly) works in PHP7" and as I said, we need to run this in production.

mircea-soaica avatar Oct 20 '16 06:10 mircea-soaica

I managed to get the fork installed but am struggling with "unknown type" on a string argument (in debug the variable looks like a string).

Any suggestions?

ghost avatar Jan 25 '17 00:01 ghost

@pfalsoncup File a bug in https://github.com/runkit7/runkit7 instead of this thread for issues with the fork.

If you can create a self-contained test case (E.g. a repo with instructions to reproduce the bug, or preferably a self-contained php file, php-config output, and optionally ini settings), that would help with fixing that.

TysonAndre avatar Jan 25 '17 00:01 TysonAndre

nvm...I ended up using json/decode+encode.

FWIW I'm just trying to trace when laravel urldecodes (as I have an app that works on one box but not another).

ghost avatar Jan 25 '17 00:01 ghost

Please support PHP7. I would consider donating as well. Several users have offered.

The current source won't even compile! I wanna use a spoon, not a fork!

ForbiddenEra avatar Feb 22 '17 08:02 ForbiddenEra

@zenovich How about name your price on kickstarter? $50k? $100k? I wouldn't be surprised if business users would put in real money. As it stands php5 is now officially deprecated (support ended in Jan 17) so my company is moving to php7, which that means we will lose runkit for our tests.

dricket avatar Mar 02 '17 04:03 dricket

@dricket A year and a half ago I had a lot of free time and started working on support for PHP7 in Runkit. I thought there had to be some people and companies interested in and willing to pay for that. There were some, actually, but $1,000 were the most generous offer from them. For that reason, I postponed the PHP7 support although I had implemented some part of this task.

Now I have a regular job and don't have much time for doing something else. But, of course, if it's possible to fundraise $100,000 for that, I will spend all my free time working on the project.

I haven't tried Kickstarter yet. Do you think it can help indeed?

zenovich avatar Mar 19 '17 16:03 zenovich

Is there a runkit project to suport PHP7?

BuaaJoseph avatar Jun 01 '17 03:06 BuaaJoseph

@zenovich I was just exploring upgrading to PHP 7 and found this sad thread. We use Runkit Sandbox extensively. I'm certain that if you setup a kickstarter/gofundme/... project that you would get some, perhaps a lot, of support.

cpriest avatar Jul 20 '17 19:07 cpriest

Especially if you added bonus spiff levels such as "Runkit for PHP7 with small feature addition." or "Runkit for PHP7 with large feature edition."

cpriest avatar Jul 20 '17 19:07 cpriest

@cpriest what do you mean by "some" and "a lot" of support? just write an order of magnitude

zenovich avatar Jul 20 '17 22:07 zenovich

You'd have a better idea of that, I've no idea how many companies / people use runkit.

cpriest avatar Jul 23 '17 16:07 cpriest

So, just to recap, instead of actually having partial, kinda buggy, PHP7 support a year ago we though it'd be better to have none?

mike-bailey avatar Aug 25 '17 21:08 mike-bailey

Folks (sorry Dima) -- you can always try https://github.com/runkit7/runkit7

A colleague developed it and thanks to it we were able to move to PHP 7 and beyond. If there are issues you have, you can always file an issue on the issue tracker on GitHub. Contributions of code are welcome, too!

mishan avatar Aug 25 '17 23:08 mishan

Just to be clear, I am aware of this, I was just commenting on how it's funny how we needed two repos/projects for this because reasons. Thanks for it!

mike-bailey avatar Aug 26 '17 00:08 mike-bailey

Alternatives: UOPZ and SoftMocks

loonies avatar Aug 26 '17 13:08 loonies

What happened?

cpriest avatar Sep 14 '18 22:09 cpriest

Zenovich is not dead. https://github.com/France-ioi/AlgoreaBackend/commit/029788bcc245ff70ae43ef9529974d1dedd7c81b

alfredleo avatar Mar 21 '19 07:03 alfredleo

Commit's even GPG signed...

mike-bailey avatar Mar 21 '19 07:03 mike-bailey

Hello, is there a plan for php 7 support? I use your module and recently I installed php 7 so I can start testing my apps and I would really appreciate if you make a php 7 version :)

I can change your product and it will works on both versions like PHP 5+ and PHP 7 as well.

vipcoders avatar Aug 21 '20 04:08 vipcoders