foglcz / JSONRpc2

Generic JSON-RPC v2 implementation
Other
19 stars 10 forks source link

PHP 8.2 - Server - fix (AllowDynamicProperties) #26

Open zabous opened 1 year ago

zabous commented 1 year ago

PHP 8.2 introduces a new attribute in the global namespace named #[AllowDynamicProperties]. Classes declared with this attribute signals PHP to not emit any deprecation notices when setting dynamic properties on objects of that class.

scottchiefbaker commented 1 year ago

Is this the best way to solve this problem? Would it be better to modify the library to not use dynamic properties?

zabous commented 1 year ago

Are you sure that it is possible without changing usage?

  • $server->inst = new MyHandler;
  • $server->method1 = function(param1, param2,