Req #78638 [NEW]: __PHP_Incomplete_Class should be final
| From: | fabien dot villepinte at gmail dot com | Date: | Sat, 05 Oct 2019 20:23:18 +0000 |
| Subject: | Req #78638 [NEW]: __PHP_Incomplete_Class should be final | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-223097@lists.php.net to get a copy of this message | ||
From: fabien dot villepinte at gmail dot com
Operating system:
PHP version: Irrelevant
Package: *General Issues
Bug Type: Feature/Change Request
Bug description:__PHP_Incomplete_Class should be final
Description:
------------
__PHP_Incomplete_Class should be final and not cloneable.
There is no meaning in letting the possibility to extend it.
This change would be a BC break but it shouldn't impact anyone.
Test script:
---------------
<?php
$c = new class('bar') extends __PHP_Incomplete_Class {
public $foo;
public function __construct($foo) {
$this->foo = $foo;
}
};
var_dump($c);
Expected result:
----------------
Fatal error: Class class@anonymous may not inherit from final class
(__PHP_Incomplete_Class) in /in/Vl5Ep on line 3
Actual result:
--------------
Notice: class@anonymous::__construct(): The script tried to execute a
method or access a property of an incomplete object. Please ensure that
the class definition "unknown" of the object you are trying to operate
on was loaded _before_ unserialize() gets called or provide an
autoloader to load the class definition in /in/Vl5Ep on line 7
object(class@anonymous)#1 (1) {
["foo"]=>
NULL
}
--
Edit bug report at https://bugs.php.net/bug.php?id=78638&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78638&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78638&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78638&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78638&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78638&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78638&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78638&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78638&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78638&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78638&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78638&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78638&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78638&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78638&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78638&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78638&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78638&r=mysqlcfg