# No static method callbacks anmore?

- Thread: https://externals.io/message/8525
- Original archive: https://news-web.php.net/php.internals/8525
- Started by Jan Schneider on 2004-03-15T16:04:05+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8526 — Hans Lellelid — 2004-03-15T16:00:09+00:00

URL: https://externals.io/message/8525#8526 · In reply to: #8525

I was just about to post the same bug ...

Except that I couldn't quite build a reproducing testcase.  I get 
exactly the same message in my code, but when I created a small static 
class to reproduce the problem it seems to work fine ... (static or 
non-static or mixture)

Hans

Jan Schneider wrote:
> Hi,
> 
> before reporting a bug, I want to make sure that this is no intentional
> change. Are static methods no longer supported as callbacks?
> 
> preg_replace_callback('/some pattern/', array('MyClass', 'Method'),
> $subject)
> 
> raises a warning atm:
> Unable to call custom replacement function in ...
> 
> Jan.
> 
> --
> http://www.horde.org - The Horde Project
> http://www.ammma.de - Neue Wege des Lernens
> http://www.tip4all.de - Deine private Tippgemeinschaft

---

## #8525 — Jan Schneider — 2004-03-15T16:04:05+00:00

URL: https://externals.io/message/8525#8525

Hi,

before reporting a bug, I want to make sure that this is no intentional
change. Are static methods no longer supported as callbacks?

preg_replace_callback('/some pattern/', array('MyClass', 'Method'),
$subject)

raises a warning atm:
Unable to call custom replacement function in ...

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - Neue Wege des Lernens
http://www.tip4all.de - Deine private Tippgemeinschaft

---

## #8527 — Andi Gutmans — 2004-03-15T16:19:04+00:00

URL: https://externals.io/message/8525#8527 · In reply to: #8525

Can you do a reverse apply of the following diff and let me know if it 
fixes the problem?
http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.274&r2=1.275&ty=u

Thanks,

Andi

At 05:04 PM 3/15/2004 +0100, Jan Schneider wrote:
>Hi,
>
>before reporting a bug, I want to make sure that this is no intentional
>change. Are static methods no longer supported as callbacks?
>
>preg_replace_callback('/some pattern/', array('MyClass', 'Method'),
>$subject)
>
>raises a warning atm:
>Unable to call custom replacement function in ...
>
>Jan.
>
>--
>http://www.horde.org - The Horde Project
>http://www.ammma.de - Neue Wege des Lernens
>http://www.tip4all.de - Deine private Tippgemeinschaft
