doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

Unknown named parameter $sessionhandler

Open JayQ1982 opened this issue 1 year ago • 2 comments

Description

The following code: https://3v4l.org/p72ZV

<?php
session_set_save_handler(
	sessionhandler: new SessionHandler(),
	register_shutdown: true
);

Resulted in this output:

Unknown named parameter $sessionhandler

But I expected this output instead: Not getting an error when using named parameters with session_set_save_handler().

PHP Version

PHP 8.4.2

Operating System

No response

JayQ1982 avatar Dec 25 '24 11:12 JayQ1982

Named parameters are not supported for alternative prototypes. This is mentioned on various documentation pages, we may add it here too.

iluuu1994 avatar Dec 25 '24 11:12 iluuu1994

Feels like this limitation is not documented, at least not in the Named Parameters documentation. As such, this feels like a general documentation issue and not one specific to session_set_save_handler().

philip avatar Feb 26 '25 00:02 philip

Feels like this limitation is not documented, at least not in the Named Parameters documentation. As such, this feels like a general documentation issue and not one specific to session_set_save_handler().

Most functions only have a single signature, for those that have multiple we usually stipulate which one cannot be used with named arguments.

Girgias avatar Mar 06 '25 13:03 Girgias