Bug #79521 [PATCH]: `__set_state` structure not been checked

From: Date: Mon, 27 Apr 2020 15:08:51 +0000
Subject: Bug #79521 [PATCH]: `__set_state` structure not been checked
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226803@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79521&edit=1 ID: 79521 Patch added by: carusogabriel@php.net Reported by: carusogabriel@php.net Summary: __set_state structure not been checked Status: Assigned Type: Bug Package: Class/Object related PHP Version: Irrelevant Assigned To: carusogabriel Block user comment: N Private report: N New Comment: The following pull request has been associated: Patch Name: [#79521] Check __set_state structure On GitHub: https://github.com/php/php-src/pull/5462 Patch: https://github.com/php/php-src/pull/5462.patch Previous Comments: ------------------------------------------------------------------------ [2020-04-26 13:08:20] carusogabriel@php.net I've opened https://github.com/php/php-src/pull/5462 to fix this. Indeed, not a documentation problem, we need to fix it. ------------------------------------------------------------------------ [2020-04-26 03:39:09] carusogabriel@php.net > Sorry, by ignored I meant that the type doesn't matter. :+1: > It really should return an object, though. It's what the method is for. In this case, we'd need an RFC removing that functionality, right? > And I totally didn't notice the RFC was yours. I'll shut up now :) Comments are always welcome, don't shut up ;) ------------------------------------------------------------------------ [2020-04-26 03:26:30] requinix@php.net Sorry, by ignored I meant that the type doesn't matter. It really should return an object, though. It's what the method is for. And I totally didn't notice the RFC was yours. I'll shut up now :) ------------------------------------------------------------------------ [2020-04-26 03:14:24] carusogabriel@php.net Related To: Bug #69718 ------------------------------------------------------------------------ [2020-04-26 03:13:11] carusogabriel@php.net > It doesn't include __set_state, but this is likely just an oversight. Yeah, I'm working on that right now, that's why I come up with this bug report. > The return value is simply being ignored. Also not an error. It isn't: it does change the result based on the type: - https://3v4l.org/jt3jL (string) - https://3v4l.org/tIHi3 (object) This is supported by the engine: https://github.com/php/php-src/blob/d21d23afef54f152d9ca661909c6d042d6bfcf48/ext/standard/var.c#L472-L593 > and it is not an error to pass more arguments than are defined in a function signature. It is not an error, this is why the documentation needs to be updated, right? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=79521 -- Edit this bug report at https://bugs.php.net/bug.php?id=79521&edit=1

« previous php.bugs (#226803) next »