I received a bug report, or rather it’s outdated:
Deprecated: Creation of dynamic property MyWebSocketUser::$requestedResource is deprecated
the code looked like this:
if (isset($headers["get"])) {
$user->requestedResource = $headers["get"];
}
With this everything is clear and fair, because the class is empty and inherits classes that do not have this property.
But an attempt to declare such a property led to nothing. In order to exclude cache or incorrect code source, I wrapped it in a method:
if (isset($headers["get"])) {
$user->setGet($headers["get"]);
}
<?php
require_once(__DIR__ . '/../websockets/users.php');
class MyWebSocketUser extends WebSocketUser
{
public $requestedResource = null;
public function setGet($get)
{
$this->requestedResource = $get;
}
}
Ubuntu, php 8.2.20, if it makes any difference
1