cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

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

Open someson opened this issue 1 year ago • 4 comments

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

  • Phalcon version: 5.2.1
  • PHP Version: PHP 8.2.3 (cli) (built: Mar 1 2023 08:20:15) (NTS)
  • Operating System: Docker (Linux 9f39b182091e 5.10.0-19-cloud-arm64 SMP Debian 5.10.149-1 (2022-10-17) aarch64 GNU/Linux)
  • Installation type: installing via package manager
  • Zephir version (if any): Version 0.17.0-$Id$
  • Server: Nginx

someson avatar Mar 05 '23 23:03 someson

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

temuri416 avatar Mar 10 '23 15:03 temuri416

This error also occurs in:

Tag::hiddenField Model method findFirstBy{Field Name}

palcoder avatar Aug 15 '23 16:08 palcoder

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

zz avatar Dec 29 '23 10:12 zz

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

ALameLlama avatar Jan 21 '24 23:01 ALameLlama