php-python icon indicating copy to clipboard operation
php-python copied to clipboard

Add PHP 5.4.x Support

Open ym opened this issue 12 years ago • 5 comments

I've made some changes ... Now it can compile successfully with PHP 5.4.x

ym avatar Jan 04 '13 10:01 ym

@ym Tx for the work well done!!!

It works as advertised build succeeds against php 5.4.10 also works for 5.5.0alpha1 and still builds against php 5.3.20.

One snag though, tests are failing =(

=====================================================================
PHP         : …/5.4.10/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 5.4.10
ZEND_VERSION: 2.4.0
PHP_OS      : Darwin - Darwin xxx.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
INI actual  : …/ext/php-python/tmp-php.ini
More .INIs  :  
CWD         : …/ext/php-python
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2013-01-12 17:54:28
=====================================================================
FAIL Python: Convert Python types to PHP types [tests/convert_to_php.phpt] 
FAIL Python: foreach [tests/foreach.phpt] 
PASS Python: INI python.optimize [tests/ini_optimize.phpt] 
PASS Python: Object (count_elements) [tests/object_count_elements.phpt] 
PASS Python: Object (dimension_delete) [tests/object_dimension_delete.phpt] 
PASS Python: Object (dimension_exists) [tests/object_dimension_exists.phpt] 
FAIL Python: Object (get_properties) [tests/object_get_properties.phpt] 
FAIL Python: Object (property_exists) [tests/object_property_delete.phpt] 
FAIL Python: Object (property_exists) [tests/object_property_exists.phpt] 
PASS Python: Object (read_dimension) [tests/object_read_dimension.phpt] 
FAIL Python: Object (read_property) [tests/object_read_property.phpt] 
PASS Python: Object (write_dimension) [tests/object_write_dimension.phpt] 
FAIL Python: Object (write_property) [tests/object_write_property.phpt] 
PASS Python: php.call() [tests/php_call.phpt] 
PASS Python: php.var() [tests/php_var.phpt] 
PASS Python: php.version() [tests/php_version.phpt] 
FAIL Python: python_call() [tests/python_call.phpt] 
PASS Python: python_eval() [tests/python_eval.phpt] 
PASS Python: python_exec() [tests/python_exec.phpt] 
PASS Python: python_version() [tests/python_version.phpt] 
PASS Python: Default streams [tests/streams_default.phpt] 
PASS Python: Default streams [tests/streams_ob.phpt] 
=====================================================================
TIME END 2013-01-12 17:54:38

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   58
---------------------------------------------------------------------

Number of tests :   22                22
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    8 ( 36.4%) ( 36.4%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   14 ( 63.6%) ( 63.6%)
---------------------------------------------------------------------
Time taken      :   10 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Python: Convert Python types to PHP types [tests/convert_to_php.phpt]
Python: foreach [tests/foreach.phpt]
Python: Object (get_properties) [tests/object_get_properties.phpt]
Python: Object (property_exists) [tests/object_property_delete.phpt]
Python: Object (property_exists) [tests/object_property_exists.phpt]
Python: Object (read_property) [tests/object_read_property.phpt]
Python: Object (write_property) [tests/object_write_property.phpt]
Python: python_call() [tests/python_call.phpt]
=====================================================================

Same results for php 5.5.x

=====================================================================
PHP         : .../5.5.0alpha1/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 5.5.0alpha1
ZEND_VERSION: 2.5.0-dev
PHP_OS      : Darwin - Darwin xxx.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
INI actual  : .../ext/php-python/tmp-php.ini
More .INIs  :  
CWD         : .../ext/php-python
Extra dirs  : 
VALGRIND    : Not used
====================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Python: Convert Python types to PHP types [tests/convert_to_php.phpt]
Python: foreach [tests/foreach.phpt]
Python: Object (get_properties) [tests/object_get_properties.phpt]
Python: Object (property_exists) [tests/object_property_delete.phpt]
Python: Object (property_exists) [tests/object_property_exists.phpt]
Python: Object (read_property) [tests/object_read_property.phpt]
Python: Object (write_property) [tests/object_write_property.phpt]
Python: python_call() [tests/python_call.phpt]
=====================================================================

Which is not the case for the php 5.3.x counterpart, 100% tests passed

=====================================================================
PHP         : .../5.3.20/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 5.3.20
ZEND_VERSION: 2.3.0
PHP_OS      : Darwin - Darwin xxx.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
INI actual  : .../ext/php-python/tmp-php.ini
More .INIs  :  
CWD         : .../ext/php-python
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2013-01-12 19:57:42
=====================================================================
PASS Python: Convert Python types to PHP types [tests/convert_to_php.phpt] 
PASS Python: foreach [tests/foreach.phpt] 
PASS Python: INI python.optimize [tests/ini_optimize.phpt] 
PASS Python: Object (count_elements) [tests/object_count_elements.phpt] 
PASS Python: Object (dimension_delete) [tests/object_dimension_delete.phpt] 
PASS Python: Object (dimension_exists) [tests/object_dimension_exists.phpt] 
PASS Python: Object (get_properties) [tests/object_get_properties.phpt] 
PASS Python: Object (property_exists) [tests/object_property_delete.phpt] 
PASS Python: Object (property_exists) [tests/object_property_exists.phpt] 
PASS Python: Object (read_dimension) [tests/object_read_dimension.phpt] 
PASS Python: Object (read_property) [tests/object_read_property.phpt] 
PASS Python: Object (write_dimension) [tests/object_write_dimension.phpt] 
PASS Python: Object (write_property) [tests/object_write_property.phpt] 
PASS Python: php.call() [tests/php_call.phpt] 
PASS Python: php.var() [tests/php_var.phpt] 
PASS Python: php.version() [tests/php_version.phpt] 
PASS Python: python_call() [tests/python_call.phpt] 
PASS Python: python_eval() [tests/python_eval.phpt] 
PASS Python: python_exec() [tests/python_exec.phpt] 
PASS Python: python_version() [tests/python_version.phpt] 
PASS Python: Default streams [tests/streams_default.phpt] 
PASS Python: Default streams [tests/streams_ob.phpt] 
=====================================================================
TIME END 2013-01-12 19:57:47

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   59
---------------------------------------------------------------------

Number of tests :   22                22
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   22 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken      :    5 seconds
=====================================================================

I am keen to get this committed and see it as a giant leap in the right direction unfortunately the tests would also have to succeed, am I right?

I will see what I can do in the meantime but lets get this sorted quick and check this off the todo list.

@ym Keep up the good work!

nickl- avatar Jan 12 '13 18:01 nickl-

I'd definitely be interested in knowing why those tests are failing under PHP 5.4 before I merge this.

jparise avatar Jan 13 '13 03:01 jparise

I haven't had all that much time to dig into this, but from what I can tell the changes applied seem to be the correct hammer for the nail. Pending further investigation...

nickl- avatar Jan 20 '13 18:01 nickl-

Thanks for patch, now it's at least compiled for 5.4. Under PHP 5.4 as mentioned before it's unstable. Objects and arrays doesnt't work:

[root@tests]# php /tests/convert_to_php.php
NULL
int(1)
int(1)
float(1.5)
string(6) "string"
string(6) "string"
string(6) "string"
Segmentation fault (core dumped)

It would be really great to have php-python working on PHP 5.4+.

arm4b avatar Jul 11 '13 19:07 arm4b

@armab please provide more details of your stack ie. versions of os, python, etc. and providing the snippets you are testing with will also help.

nickl- avatar Aug 03 '13 23:08 nickl-