⚲
Project
General
Profile
Sign in
Home
Projects
Help
Search
:
TYPO3 Core
All Projects
TYPO3 Core
Overview
Activity
Roadmap
Issues
Repository
Download (704 Bytes)
Bug #53682
» test.php
Chris Zepernick
, 2013-11-27 00:09
<?php
interface
nerd
{
public
function
getVariable
();
}
class
freak
implements
nerd
{
protected
$variable
;
/**
* Fehler fall:
* public function __construct( &$e){
* $this->variable = $e;
* }
*/
public
function
__construct
(
&
$e
){
$this
->
variable
=
$e
;
}
public
function
getVariable
(){
return
$this
->
variable
;
}
}
function
getNew
()
{
$a
=
func_get_args
();
$c
=
array_shift
(
$a
);
$r
=
new
ReflectionClass
(
$c
);
return
$r
->
newInstanceArgs
(
$a
);
}
$e
=
'new stdClass()'
;
$freakClass
=
getNew
(
'freak'
,
$e
);
if
(
$freakClass
instanceof
nerd
){
var_dump
(
$freakClass
);
var_dump
(
$freakClass
->
getVariable
());
}
else
{
print
(
"something wrong
\n
"
);
}
« Previous
1
2
Next »
(1-1/2)
Loading...