cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

PHP7 Support

Open quantumpacket opened this issue 11 years ago • 51 comments

PHP7 betas should be rolling out next month, so I think at least master should support it for testing purposes.

In PHP7 etc/standard/php_smart_str.h has been renamed to etc/standard/php_smart_string.h.

Compilation for master, 2.0.0, and 2.0.x both fail with the following error:

/tmp/compile_php_phalcon/cphalcon-2.0.x/build/64bits/phalcon.zep.c:184:40: fatal error: ext/standard/php_smart_str.h: No such file or directory #include <ext/standard/php_smart_str.h> ^ compilation terminated. make: *** [phalcon.lo] Error 1

I don't know C, otherwise would submit a patch. :)

quantumpacket avatar May 20 '15 01:05 quantumpacket

This is not an easy task, migration to PHP7 must have to be done in Zephir: https://github.com/phalcon/zephir/issues/952

andresgutierrez avatar May 20 '15 01:05 andresgutierrez

@andresgutierrez PHP 7 will be far faster than php5, also there is HHVM and Hacklang. Additionally, you have said migrating Zephir to PHP 7 is really time and effort demanding if not impossible. What is the point in migrating Zephir to PHP7. Why not you port the lovely Phalon to plain PHP instead? A huge number of PHP programmer can contribute, we will have 16 github issues instead of 612 issues. Those who started large project using Phalcon have not to migrate all of their code to another PHP framework and Phalcon will live forever. Phalcon can be "The PHP Framework For Web Artisans". Facebook and Zend have a lot of money to make PHP fast and faster. Please focus on pleasure and quality of PHP programming.

salarmehr avatar May 26 '15 11:05 salarmehr

@salarmehr I said is not an easy task not that it is impossible, I can't see your point, PHP7 is not faster than Zephir can be, also, Zephir is a powerful and easy language to use and more people is contributing to Phalcon. Do you think that write the PHQL/Volt parser in PHP7 will be faster than the one written in pure C? One thing is that you want to believe something and other is that it's real

andresgutierrez avatar May 26 '15 12:05 andresgutierrez

@salarmehr facepalm

ovr avatar May 26 '15 12:05 ovr

I did not claimed that PHP7 is faster than Zephir. I said "PHP 7 will be far faster than php5". I can understand you. You spent long time developing Zephir, on the other hand, I and others in Phalcon community investigate on Phalcon, we learned it deeply and used it as a foundation for our projects.

In Zephir home page you introduced it as a single-purpose language: "designed to ease the creation and maintainability of extensions for PHP ". Its a programming language designed for another language. If you plan to make it more versatile and writing pure-zephir web application possible (similar to what Hack do) it's a different story.

Please also take a look at this page: https://github.com/laravel/framework/issues/3295

salarmehr avatar May 26 '15 13:05 salarmehr

What is PHP 6?

hdogan avatar May 26 '15 13:05 hdogan

@hdogan My bad, PHP5 ◕‿◕

salarmehr avatar May 26 '15 13:05 salarmehr

Major :-1: to switching away from zephir. Zephir is almost as simple as php, while being in many cases significantly faster.

Green-Cat avatar May 26 '15 13:05 Green-Cat

Guys: http://php.net/archive/2015.php#id2015-12-03-1

PHP 7.0.0 Released

JCMais avatar Dec 03 '15 22:12 JCMais

@andresgutierrez , maybe if you create a list of "things" that has to be changed, with files and a very tiny hints, in a separated issue, create a new branch ( maybe 2.2 or directly on 2.1.x or 3.0 ?), and see if any of us can help you make phalcon works with php7. Unless you are already at the finishing point :D

Izopi4a avatar Dec 04 '15 07:12 Izopi4a

I'd like to see Phalcon/Zephir ported to PHP 7. I'm using it for 18 months on a very big project (the project wasn't launched yet) with 10 other developers and would like to be able to continue using it. And now that PHP 7 has been released, a lot of people will start using it. Of course, there is a window of time where the most paranoid, like myself, will not update to the new version so soon. But definitely we would like that to happen in a good time-frame.

andrefauth avatar Dec 04 '15 12:12 andrefauth

Zephir works with PHP 7 (phalcon/zephir/issues/756), but there is still some C code in Phalcon which needs to be fixed. Hope someone will take a look at it sometime soon. Would love to be able to use PHP 7 with Phalcon.

hakimio avatar Dec 07 '15 10:12 hakimio

+1

Rewt0r avatar Dec 08 '15 09:12 Rewt0r

+1

hzxie avatar Dec 11 '15 00:12 hzxie

:+1:

lianguan avatar Dec 11 '15 01:12 lianguan

+1

JakeGlascock avatar Jan 04 '16 21:01 JakeGlascock

+1

phpclub avatar Feb 19 '16 17:02 phpclub

@quantumpacket, @phpclub, @JakeGlascock, @phecho, @zjhzxhz, @Rewt0r, @hakimio,@andrefauth, @Izopi4a, @JCMais, @Green-Cat, @salarmehr, @hdogan

Hey mans, now you can try Phalcon 2.1.x with PHP 7. Just use latest Zephir with zephir build —backend=ZendEngine3 command

sergeyklay avatar Feb 19 '16 20:02 sergeyklay

Well, is there anything need for test or it should work as it is ?

Jurigag avatar Feb 19 '16 22:02 Jurigag

i will report tomorrow, busy playing diablo 3 atm :D

Izopi4a avatar Feb 19 '16 22:02 Izopi4a