colder / php-weakref

PECL extension that implements weak references and weak maps in PHP
http://pecl.php.net/weakref
Other
36 stars 13 forks source link

Possible PHP 5.3 Compat issue #7

Closed cacsar closed 12 years ago

cacsar commented 12 years ago

Great, let me know if I can be of assistance.


Dear Christian,

Thanks for this report, people with github accounts usually report them as issues on the github project page.

From the error it seems like it is an mistake on my side, I probably did not check that it still worked on 5.3 when releasing 0.2.1. PHP defines various macros that are not always available in every versions.

I will fix it as soon as I can, which will probably coincide with when I return from holidays :)

Best,

On Tue, Jul 24, 2012 at 12:21 AM, Christian Csar <> wrote:

Etienne, I'm using your WeakRef extension for a library I'm working on as weak references are the correct solution, and I'm running into the below error which looks to be a linking error vs an error in the php code. If there's a more appropriate support path, please let me know, or CC it as appropriate (i.e. filing the first bug in the bugtracker or the PECL dev list). Weakref lists itself compatible with PHP 5.3 - 5.5 and is giving an error on 5.3.3 debian squeeze but not 5.4.4 fedora 17. Any guidance you can provide would be appreciated. I am happy to provide additional information as needed. Strace suggests that weakref.so is successfully being opened (and I believe such errors would result in a different message).

Given the file weakRefTest.php <?php $x = new StdClass; $ref = new WeakRef($x); $y = $ref->acquire(); ?> "php weakRefTest.php" gives "php: symbol lookup error: /usr/lib/php5/20090626/weakref.so: undefined symbol: ZVAL_COPY_VALUE"

on our Debian dev server using the following: $pecl info WeakRef

ABOUT PECL.PHP.NET/WEAKREF-0.2.1

Release Type PECL-style PHP extension (source code) Name Weakref Channel pecl.php.net Summary Implementation of weak references Description A weak reference provides a gateway to an object without preventing that object from being collected by the garbage collector (GC). Maintainers Etienne Kneuss colder@php.net (lead) Release Date 2012-06-19 15:09:07 Release Version 0.2.1 (beta) API Version 0.2.1 (beta) License PHP (http://www.php.net/license) Release Notes - Fixes crashes and bugs caused by zval splitting. Required Dependencies PHP version 5.3.0-5.5.0 PEAR installer version 1.4.0b1 or newer Not Compatible with PHP versions 6.0.0 package.xml version 2.0 Last Modified 2012-07-20 21:13 Previous Installed - None - Version

$pear version PEAR Version: 1.9.4 PHP Version: 5.3.3-7+squeeze13 Zend Engine Version: 2.3.0 Running on: Linux www01 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64

On my Fedora 17 dev machine with PHP and php-pear from the fedora repositories, and weakref from PECL, the code appears to work fine with no error being given.

$pear version PEAR Version: 1.9.4 PHP Version: 5.4.4 Zend Engine Version: 2.4.0 Running on: Linux laurence 3.4.4-5.fc17.x86_64 #1 SMP Thu Jul 5 20:20:59 UTC 2012 x86_64 $pecl info WeakRef

ABOUT PECL.PHP.NET/WEAKREF-0.2.1

Release Type PECL-style PHP extension (source code) Name Weakref Channel pecl.php.net Summary Implementation of weak references Description A weak reference provides a gateway to an object without preventing that object from being collected by the garbage collector (GC). Maintainers Etienne Kneuss colder@php.net (lead) Release Date 2012-06-19 15:09:07 Release Version 0.2.1 (beta) API Version 0.2.1 (beta) License PHP (http://www.php.net/license) Release Notes - Fixes crashes and bugs caused by zval splitting. Required Dependencies PHP version 5.3.0-5.5.0 PEAR installer version 1.4.0b1 or newer Not Compatible with PHP versions 6.0.0 package.xml version 2.0 Last Modified 2012-07-23 22:07 Previous Installed - None -

colder commented 12 years ago

That's odd, it compiles and runs fine on latest 5.3, even though this macro does not exist in 5.3

colder@box ~/git/weakref [master] $ php53 -v
PHP 5.3.12-dev (cli) (built: Jul 25 2012 21:57:00) (DEBUG)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

colder@box ~/git/weakref [master] $ php53 -dextension=weakref.so -m | grep Weakref
Weakref

I must have messed up something somewhere, strange.

colder commented 12 years ago

I have released 0.2.2 which should fix this issue. Please tell me if you have any trouble using this one on 5.3.

Best,