From: clemens at gutweiler dot net
Operating system: Linux 2.6.3
PHP version: 5.0.0RC2
PHP Bug Type: Class/Object related
Bug description: Instance of Interface
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 bug report at http://bugs.php.net/?id=28641&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28641&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28641&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28641&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28641&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28641&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28641&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28641&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28641&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28641&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28641&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28641&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28641&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28641&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28641&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28641&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28641&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28641&r=float