Re: [PHP-DEV] get_class behavior

2016-01-29 Thread Rowan Collins
Dan Ackroyd wrote on 29/01/2016 13:56: On 29 January 2016 at 10:46, Rowan Collins wrote: You appear to be suggesting that "get_class()" should behave differently than "get_class(null)". I don't know if internal parameter handling (ZPP) works like userland parameters Regardless of how internals

Re: [PHP-DEV] get_class behavior

2016-01-29 Thread Dan Ackroyd
On 29 January 2016 at 10:46, Rowan Collins wrote: > > You appear to be suggesting that "get_class()" should behave differently > than "get_class(null)". > I don't know if internal parameter handling (ZPP) works like userland > parameters Regardless of how internals works, it's a thing in userland

Re: [PHP-DEV] get_class behavior

2016-01-29 Thread Dan Ackroyd
On 28 January 2016 at 23:22, Lorenzo Fontana wrote: > > Yes is what I would like to do, start saying people that they should change > that by triggering a deprecation notice so they can refactor their code. I don't think we need a deprecation notice. The behaviour when the function is passed a nu

Re: [PHP-DEV] get_class behavior

2016-01-29 Thread Rowan Collins
Dan Ackroyd wrote on 28/01/2016 22:35: ## Refactoring if non-objects are no longer allowed. Current code: echo get_class($result); Would need to be changed to: if ($result === null) { echo get_class(); } else { echo get_class($result); } You appear to be suggesting that "get_class()" sh

Re: [PHP-DEV] get_class behavior

2016-01-28 Thread Lorenzo Fontana
2016-01-29 0:22 GMT+01:00 Lorenzo Fontana : > 2016-01-28 23:35 GMT+01:00 Dan Ackroyd : > >> On 28 January 2016 at 19:17, Lorenzo Fontana >> wrote: >> > Hello everybody! >> >> Hello Lorenzo, >> >> >> > If *$result* is *null* the output of *get_class* is the name of the >> > containing class instea

Re: [PHP-DEV] get_class behavior

2016-01-28 Thread Lorenzo Fontana
2016-01-28 23:35 GMT+01:00 Dan Ackroyd : > On 28 January 2016 at 19:17, Lorenzo Fontana > wrote: > > Hello everybody! > > Hello Lorenzo, > > > > If *$result* is *null* the output of *get_class* is the name of the > > containing class instead of the name of the object I wanted. > > Yes, that is ba

Re: [PHP-DEV] get_class behavior

2016-01-28 Thread Dan Ackroyd
On 28 January 2016 at 19:17, Lorenzo Fontana wrote: > Hello everybody! Hello Lorenzo, > If *$result* is *null* the output of *get_class* is the name of the > containing class instead of the name of the object I wanted. Yes, that is bad. Perhaps a smaller change would give you the desired behav

[PHP-DEV] get_class behavior

2016-01-28 Thread Lorenzo Fontana
Hello everybody! At the moment the *get_class *function has three possible behaviors - *get_class* is called with the instance of the class and return the name of the class name of the instance; - *get_class* is called without any parameters inside a class and return the containing class name - *g

[PHP-DEV] get_class

2011-09-01 Thread Todd Ruth
$x = null; get_class($x) returns get_class($this) as of 5.3. I don't recall seeing a discussion of this on the list and I can't find anything about this change in the archives. The documentation is currently self-contradictory... Under "Return Values": Returns the name of the class of which objec

Re: [PHP-DEV] get_class inconsistency

2011-02-23 Thread Benjamin Eberlei
No, this wouldnt be backwards compatible to the PHP 5.2 behavior, hence inconsistent. The convention is class names in strings are ALWAYS fully qualified, therefore the prefix backslash is not necessary. On Wed, 23 Feb 2011 15:14:45 -0300 Martin Scotta wrote: > Hi all, > > would it be safer