php-windows Digest 2 Aug 2012 16:49:48 -0000 Issue 4060

Topics (messages 30938 through 30939):

PHP 5.4 extension building problem
        30938 by: Carlo Pastorino

Referrring to a class object's internal/own function via string referral
        30939 by: Jacob Kruger

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hello everybody,

I have a project which uses a custom made php extension which adds some
"native" functionalities and classes to the php framework on Windows.
In order to build this extension I use a Visual Studio solution correctly
configured (I guess) to add the correct php headers and preprocessor
definitions.
My problem is that my extension (and my Visual Studio project), which was
working fine using php5.2 and php5.3, is giving me linking errors using
php5.4.5.

In particular, I get the following error when building the extension:

unresolved external symbol "__declspec(dllimport) char const * (__cdecl*
zend_new_interned_string)(char const *,int,int,void * * *)"
(__imp_?zend_new_interned_string@@3P6APBDPBDHHPAPAPAX@ZA)

this symbol is used by the INIT_CLASS_ENTRY macro and should be defined in
the zend_string.h header but, here I am totally guessing, I think some
missing "#define" in my code is preventing my extension to be linked
correctly.

However, enough with the talk, I prepared a simple Visual Studio 2010
solution containing a very simple extension implementation which should let
you see the problem.
You can find it here:

http://neologica.it/test_ext.7z

Everything needed to build is contained with the archive. 
The solutions contains 2 main configuration, *._5.3 and *.5.4 which
respectively use php5.3 headers and lib, and php5.4(.5) headers and lib. By
"lib" I mean the php5ts.lib found inside the php binary package under the
"dev" folder.
The first one builds and works fine producing the dll for the extension
while the second one should display the error.

Can anyone help me with this issue? Or, at least, point me to someone (or
somewhere) where I can find any help?

Thank you in advance,
Regards
Carlo Pastorino.




--- End Message ---
--- Begin Message ---
I want to make use of array_walk_recursive, inside a function definition, 
inside a class definition, to apply another of the class' internal functions 
recursively to every member of an array class property, and one of the 
parameters it requires is the string name of the function to implement in it's 
usage:
bool array_walk_recursive ( array &$input , callable $funcname [, mixed 
$userdata = NULL ] )

However, this works fine if I am referring to making use of a sort of global, 
externally defined function, but, since you literally pass it the name of the 
function to make use of in a string value, how would I thus refer to a function 
defined inside the class definition?

This is, since, something along the lines of the following three examples both 
don't work for varying/different reasons:
array_walk_recursive($arToPass, "$this->functionName", $extraParameter);
array_walk_recursive($artoPass, '$this->funcName', $extraParameter);
array_walk_recursive($artoPass, "funcName", $extraParameter);

Also tried assigning another variable the value of the function before then 
trying to pass it through, but that also doesn't work:
$fn = $this->funcName;
array_walk_recursive($arToPass, $fn, $extraParameter);

Thus, what am wondering is if you need to pass a reference to a function 
through to another process/function/method, using the string value of it's 
name, etc., how would you then refer to something like the parent class' 
internally defined function as such?

TIA

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

--- End Message ---

Reply via email to