Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- static variables in methods inherited from parent class --FILE-- <?php class C { ..
Decoded Output download
--TEST--
static variables in methods inherited from parent class
--FILE--
<?php
class C {
function foo ($y = null) {
static $x = null;
if (!is_null($y)) {
$x = [$y];
}
return $x;
}
}
$c = new C();
$c->foo(42);
$d = new class extends C {};
var_dump($d->foo());
var_dump($d->foo(24));
var_dump($c->foo());
?>
--EXPECT--
array(1) {
[0]=>
int(42)
}
array(1) {
[0]=>
int(24)
}
array(1) {
[0]=>
int(24)
}
Did this file decode correctly?
Original Code
--TEST--
static variables in methods inherited from parent class
--FILE--
<?php
class C {
function foo ($y = null) {
static $x = null;
if (!is_null($y)) {
$x = [$y];
}
return $x;
}
}
$c = new C();
$c->foo(42);
$d = new class extends C {};
var_dump($d->foo());
var_dump($d->foo(24));
var_dump($c->foo());
?>
--EXPECT--
array(1) {
[0]=>
int(42)
}
array(1) {
[0]=>
int(24)
}
array(1) {
[0]=>
int(24)
}
Function Calls
None |
Stats
MD5 | 6d756677de7225661c6b918cbaad41f3 |
Eval Count | 0 |
Decode Time | 101 ms |