Req #80042 [NEW]: ArrayObject not implement magic methods, but use they
| From: | antonfedonyuk at gmail dot com | Date: | Mon, 31 Aug 2020 19:20:23 +0000 |
| Subject: | Req #80042 [NEW]: ArrayObject not implement magic methods, but use they | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-228827@lists.php.net to get a copy of this message | ||
From: antonfedonyuk at gmail dot com
Operating system: Any
PHP version: 7.4.9
Package: Class/Object related
Bug Type: Feature/Change Request
Bug description:ArrayObject not implement magic methods, but use they
Description:
------------
Example show: $ao don't have public properties, object not implements
method __get, but "magic" still work.
Test script:
---------------
<?php
$ao = new ArrayObject(['foo' => 'bar'], ArrayObject::ARRAY_AS_PROPS);
var_dump(get_object_vars($ao));
// []
var_dump(method_exists($ao, '__get'));
// false
var_dump($ao->foo);
// "bar"
?>
Expected result:
----------------
Test object $ao must have public property "foo" or implements magic
methods(__get, __set", __isset, __unset) to overloading that property.
Actual result:
--------------
get_object_vars($ao); // []
method_exists($ao, '__get'); // false
$ao->foo; // "bar"
--
Edit bug report at https://bugs.php.net/bug.php?id=80042&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80042&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80042&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80042&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80042&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80042&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80042&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80042&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80042&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80042&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80042&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80042&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80042&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80042&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80042&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80042&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80042&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80042&r=mysqlcfg