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-- Test that the mixed type is reflectable --FILE-- <?php class A { public mixed..

Decoded Output download

--TEST--
Test that the mixed type is reflectable
--FILE--
<?php
class A
{
    public mixed $a;

    public function test(mixed ...$a): mixed {}
}

$a = new A();

$object = new ReflectionObject($a);
$method = new ReflectionMethod($a, "test");

var_dump($object->getProperty("a")->getType()->getName());
var_dump($method->getParameters()[0]->getType()->getName());
var_dump($method->getReturnType()->getName());

var_dump((string) $object->getProperty("a")->getType());
var_dump((string) $method->getParameters()[0]->getType());
var_dump((string) $method->getReturnType());

?>
--EXPECT--
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"

Did this file decode correctly?

Original Code

--TEST--
Test that the mixed type is reflectable
--FILE--
<?php
class A
{
    public mixed $a;

    public function test(mixed ...$a): mixed {}
}

$a = new A();

$object = new ReflectionObject($a);
$method = new ReflectionMethod($a, "test");

var_dump($object->getProperty("a")->getType()->getName());
var_dump($method->getParameters()[0]->getType()->getName());
var_dump($method->getReturnType()->getName());

var_dump((string) $object->getProperty("a")->getType());
var_dump((string) $method->getParameters()[0]->getType());
var_dump((string) $method->getReturnType());

?>
--EXPECT--
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"
string(5) "mixed"

Function Calls

None

Variables

None

Stats

MD5 a79bb7fb00543871074023fe8a56ea20
Eval Count 0
Decode Time 79 ms