Bug #28641 [Com]: Instance of Interface
| From: | a at hi5job dot com | Date: | Fri, 24 Sep 2021 07:14:14 +0000 |
| Subject: | Bug #28641 [Com]: Instance of Interface | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236806@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=28641&edit=1
ID: 28641
Comment by: a at hi5job dot com
Reported by: clemens at gutweiler dot net
Summary: Instance of Interface
Status: Closed
Type: Bug
Package: Class/Object related
Operating System: Linux 2.6.3
PHP Version: 5.0.0RC2
Block user comment: N
Private report: N
New Comment:
https://hi5job.com
https://hi5job.com/blog
https://hi5job.com/jobs
Apply latest Jobs
Previous Comments:
------------------------------------------------------------------------
[2004-06-05 17:00:08] helly@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2004-06-05 11:25:28] clemens at gutweiler dot net
Description:
------------
Its possible to create an instance of an interface
PHP Version: 5.0.0RC3RC2
Reproduce code:
---------------
php5-1.php:
<?php
class foo {
public $member = 'value';
}
session_start( );
$_SESSION['foo'] = new foo;
?>
<a href="php5-2.php">next</a>
php5-2.php:
<?php
interface foo {
}
function __autoload( $name ) {
var_dump( '__autoload(): '.$name );
}
session_start( );
var_dump( $_SESSION );
?>
Expected result:
----------------
the following should occur:
- call __autoload()
- if class foo isnt available: display error: Cannot instantiate interface foo at sesstion_start()
or something
Actual result:
--------------
array(1) {
["foo"]=>
object(foo)#1 (1) {
["member"]=>
string(5) "value"
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=28641&edit=1