# בעיה עם "שימוש ב-'self' בקריאות הוא הוצא משימוש" ב-WP-Discourse

**URL:** https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543
**Category:** WordPress
**Created:** [1 במרץ,‏ 2024,‏ 10:22pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543 "2024-03-01T22:22:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kendoer](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kendoer](https://meta.discourse.org/u/kendoer)
#### Post date: [1 במרץ,‏ 2024,‏ 10:22pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543/1 "2024-03-01T22:22:07Z")

</div>

Hello ! I opened WP\_DEBUG to test some functions, and see this message:

> **Deprecated** : Use of “self” in callables is deprecated in **/wp-content/plugins/wp-discourse/lib/discourse.php** on line **225**

This message shows in PHP8.2 and 8.3. It’s fine with PHP below&include 8.1.

Is there anything we could do to resolve this? I tend to use PHP8.3 as it shows better performance than 8.1. Thank you very much!

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [1 במרץ,‏ 2024,‏ 11:22pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543/2 "2024-03-01T23:22:05Z")

</div>

Hello,

No worry; it’s only a [deprecation](https://wiki.php.net/rfc/deprecate_partially_supported_callables) and will be removed in PHP 9 (which is far in the future).  
You still can use PHP 8.3. :+1:

Simon,

> <https://github.com/discourse/wp-discourse/blob/main/lib/discourse.php#L225>

I believe this should be used now: `self::class . 'register_text_translations'`

---

<div class="post-metadata">

### Author: ![kendoer](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@kendoer](https://meta.discourse.org/u/kendoer)
#### Post date: [2 במרץ,‏ 2024,‏ 12:08pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543/3 "2024-03-02T12:08:29Z")

</div>

Thank you very much!

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [2 במרץ,‏ 2024,‏ 8:51pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543/4 "2024-03-02T20:51:13Z")

</div>

Just to share that someone made a PR a few months ago to fix this:

> <https://github.com/discourse/wp-discourse/pull/495>
>
> Fix PHP Deprecated message (Use of "self" in callables is deprecated) on line 22…5

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1 באפריל,‏ 2024,‏ 8:51pm UTC](https://meta.discourse.org/t/problem-with-use-of-self-in-callables-is-deprecated-in-wp-discourse/297543/5 "2024-04-01T20:51:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
