php-windows Digest 4 Aug 2012 13:52:56 -0000 Issue 4061

Topics (messages 30940 through 30942):

Re: Referrring to a class object's internal/own function via string referral
        30940 by: Keith Davis
        30941 by: Jacob Kruger

Page refusing to render when published up to actual linux hosting machine..?
        30942 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 ---
Like this:

array_walk_recursive($arToPass, array($this, "functionName"),
$extraParameter);

It's the same syntax of call_user_func().



Keith Davis (214) 906-5183


-----Original Message-----
From: Jacob Kruger [mailto:ja...@blindza.co.za]
Sent: Thursday, August 02, 2012 11:49 AM
To: php-wind...@lists.php.net
Subject: [PHP-WIN] Referrring to a class object's internal/own function
via string referral

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...'


This message (including any attachments) may contain confidential or otherwise 
privileged information and is intended only for the individual(s) to which it 
is addressed. If you are not the named addressee you should not disseminate, 
distribute or copy this e-mail. Please notify the sender immediately by e-mail 
if you have received this e-mail by mistake and delete this e-mail from your 
system. E-mail transmission cannot be guaranteed to be secured or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message or that arise as a 
result of e-mail transmission. If verification is required please request a 
hard-copy version from the sender.

www.pridedallas.com


--- End Message ---
--- Begin Message ---
Cool.

Thanks.

And, makes sense, but, was escaping me up to now...<smile>

Stay well

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

----- Original Message ----- From: "Keith Davis" <keithda...@pridedallas.com>
To: "Jacob Kruger" <ja...@blindza.co.za>; <php-wind...@lists.php.net>
Sent: Thursday, August 02, 2012 7:47 PM
Subject: RE: [PHP-WIN] Referrring to a class object's internal/own function via string referral


Like this:

array_walk_recursive($arToPass, array($this, "functionName"),
$extraParameter);

It's the same syntax of call_user_func().



Keith Davis (214) 906-5183


-----Original Message-----
From: Jacob Kruger [mailto:ja...@blindza.co.za]
Sent: Thursday, August 02, 2012 11:49 AM
To: php-wind...@lists.php.net
Subject: [PHP-WIN] Referrring to a class object's internal/own function
via string referral

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...'


This message (including any attachments) may contain confidential or otherwise privileged information and is intended only for the individual(s) to which it is addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message or that arise as a result of e-mail transmission. If verification is required please request a hard-copy version from the sender.

www.pridedallas.com



--- End Message ---
--- Begin Message ---
The following page, which is part of a sort of test process, refuses to seem to 
even render headers/footers/content, etc.:
http://www.blindza.co.za/treeView/edit.php?id=1

If you want to have a look at the actual file, check out:
https://dl.dropbox.com/u/13327195/edit.php

Think have come across similar things in past with character encoding issues, 
dummy/nasty characters in the pages, etc., since this works perfectly alright 
on my windows machine this side, but, doesn't want to be served by live server 
as such...

Thoughts...?

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

--- End Message ---

Reply via email to