[php-src] Issue #11539: Notice on object - non-object comparison

From: Date: Mon, 26 Jun 2023 15:06:32 +0000
Subject: [php-src] Issue #11539: Notice on object - non-object comparison
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244817@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11539 Author: ColinHDev ### Description I was looking through the source code to find out how different types are compared. And while looking at the comparison between an object and a non-object, I noticed the following few lines: https://github.com/php/php-src/blob/master/Zend/zend_object_handlers.c#L1705-L1718 If the object cannot be cast to the other type, a Notice is given, but only if the target type is either a long or double. My question is if this is intentional or a bug. Because intuitively I would always expect a Notice when such a casting fails and not only if the target has a certain type. ### PHP Version PHP 8.2.3 ### Operating System _No response_

« previous php.bugs (#244817) next »