phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.79k stars 1.97k forks source link

[BUG]: Deprecated: Use of "self" in callables is deprecated #16305

Open someson opened 1 year ago

someson commented 1 year ago

Volt view with <title>{{ get_title() }}</title> produces following deprecation noctice:

<title><br />
<b>Deprecated</b>:  Use of "self" in callables is deprecated in <b>/var/www/storage/cache/volt/_var_www_app_shared_views_error.volt.php</b> on line <b>5</b><br />
<br />
<b>Deprecated</b>:  Use of "self" in callables is deprecated in <b>/var/www/storage/cache/volt/_var_www_app_shared_views_error.volt.php</b> on line <b>5</b><br />
<br />
<b>Deprecated</b>:  Use of "self" in callables is deprecated in <b>/var/www/storage/cache/volt/_var_www_app_shared_views_error.volt.php</b> on line <b>5</b><br />
</title>

Additional info:

error_reporting(E_ALL);

Details

temuri416 commented 1 year ago

Two things that I saw after updating to php 8.2:

$this->di->getShared('url')->getBaseUri();

results in:

Deprecated: Creation of dynamic property MyApp::$di is deprecated in /var/web/nginx/html/myApp/app/App.php on line 46

And

echo Phalcon\Tag::renderTitle();

results in: Deprecated: Use of "self" in callables is deprecated in /var/web/nginx/html/myApp/app/modules/public/views/phtml/partials/header.phtml on line 16

palcoder commented 1 year ago

This error also occurs in:

Tag::hiddenField Model method findFirstBy{Field Name}

zz commented 10 months ago

so we have to lock project phalcon version to PHP8.1

ALameLlama commented 9 months ago

For now, looks like it's an upstream issue. https://github.com/zephir-lang/zephir/issues/2405