Re: [RFC] get_class() disallow null parameter

From: Date: Sun, 14 Aug 2016 22:14:58 +0000
Subject: Re: [RFC] get_class() disallow null parameter
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-95152@lists.php.net to get a copy of this message
On 14 August 2016 at 22:48, Stanislav Malyshev <smalyshev@gmail.com> wrote: > > Could you please clarify what you mean by "disallow"? It will be the standard behaviour for accepting params. The patch is just: - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &obj) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o", &obj) == FAILURE) { but I have added a clear description to the RFC: > If get_class() is called with null as the parameter, a warning will be emitted: > > Warning: get_class() expects parameter 1 to be object, null given in %s on line %d cheers Dan

« previous php.internals (#95152) next »