Bug #81467 [NEW]: (object) casting of array should validate keynames
| From: | wyattbiker at gmail dot com | Date: | Wed, 22 Sep 2021 20:36:33 +0000 |
| Subject: | Bug #81467 [NEW]: (object) casting of array should validate keynames | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-236759@lists.php.net to get a copy of this message | ||
From: wyattbiker at gmail dot com
Operating system: mac os x
PHP version: 8.0.10
Package: Class/Object related
Bug Type: Bug
Bug description:(object) casting of array should validate keynames
Description:
------------
When casting an associative array to an object it should verify that in
fact it is creating valid object property names.
E.g.this should produce an error.
$x=(object) array('20'=>'abc');
echo $x->20; // << ERROR obviously
Test script:
---------------
$x=(object) array('x20'=>'abc');
echo $x->x20; // OK
$x=(object) array('20'=>'abc');
echo $x->20; // << ERROR obviously
--
Edit bug report at https://bugs.php.net/bug.php?id=81467&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81467&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81467&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81467&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81467&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81467&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81467&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81467&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81467&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81467&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81467&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81467&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81467&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81467&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81467&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81467&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81467&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81467&r=mysqlcfg