Bug #76472 [Opn->Wfx]: Array functions ignore object property permissions
Edit report at https://bugs.php.net/bug.php?id=76472&edit=1
ID: 76472
Updated by: nikic@php.net
Reported by: php at darkain dot com
Summary: Array functions ignore object property permissions
-Status: Open
+Status: Wont fix
Type: Bug
Package: Scripting Engine problem
Operating System: Debian 9
PHP Version: 7.2.6
Block user comment: N
Private report: N
New Comment:
Using current() etc. with objects is deprecated as of PHP 8.1, so this will get resolved in due
time. We're not going to change the behavior in the meantime.
Relevant RFC: https://wiki.php.net/rfc/deprecations_php_8_1#key_current_next_prev_reset_on_objects
Previous Comments:
------------------------------------------------------------------------
[2018-06-13 16:28:25] php at darkain dot com
Description:
------------
Using foreach on an object, protected/private members are skipped over.
Using current(), next(), prev(), end(), reset() on an object, private/protected members are
accessible.
These functions entirely bypass object property permissions.
Test script:
---------------
This effects all versions of PHP.
https://3v4l.org/5e6Ok
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76472&edit=1
Thread (2 messages)