Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php use Illuminate\Support\Fluent; use function PHPStan\Testing\assertType; $fluent =..

Decoded Output download

<?php

use Illuminate\Support\Fluent;

use function PHPStan\TestingssertType;

$fluent = new Fluent(['name' => 'Taylor', 'age' => 25, 'user' => new User]);

assertType('Illuminate\Support\Fluent<string, int|string|User>', $fluent);
assertType('Illuminate\Support\Fluent<string, string>', new Fluent(['name' => 'Taylor']));
assertType('Illuminate\Support\Fluent<string, int>', new Fluent(['age' => 25]));
assertType('Illuminate\Support\Fluent<string, User>', new Fluent(['user' => new User]));

assertType('int|string|User|null', $fluent['name']);
assertType('int|string|User|null', $fluent['age']);
assertType('int|string|User|null', $fluent['age']);
assertType('int|string|User|null', $fluent->get('name'));
assertType('int|string|User|null', $fluent->get('foobar'));
assertType('int|string|User', $fluent->get('foobar', 'zonda'));
assertType('array<string, int|string|User>', $fluent->getAttributes());
assertType('array<string, int|string|User>', $fluent->toArray());
assertType('array<string, int|string|User>', $fluent->jsonSerialize());
 ?>

Did this file decode correctly?

Original Code

<?php

use Illuminate\Support\Fluent;

use function PHPStan\Testing\assertType;

$fluent = new Fluent(['name' => 'Taylor', 'age' => 25, 'user' => new User]);

assertType('Illuminate\Support\Fluent<string, int|string|User>', $fluent);
assertType('Illuminate\Support\Fluent<string, string>', new Fluent(['name' => 'Taylor']));
assertType('Illuminate\Support\Fluent<string, int>', new Fluent(['age' => 25]));
assertType('Illuminate\Support\Fluent<string, User>', new Fluent(['user' => new User]));

assertType('int|string|User|null', $fluent['name']);
assertType('int|string|User|null', $fluent['age']);
assertType('int|string|User|null', $fluent['age']);
assertType('int|string|User|null', $fluent->get('name'));
assertType('int|string|User|null', $fluent->get('foobar'));
assertType('int|string|User', $fluent->get('foobar', 'zonda'));
assertType('array<string, int|string|User>', $fluent->getAttributes());
assertType('array<string, int|string|User>', $fluent->toArray());
assertType('array<string, int|string|User>', $fluent->jsonSerialize());

Function Calls

None

Variables

None

Stats

MD5 e059672d7c36070769fc3bec3a750ef8
Eval Count 0
Decode Time 96 ms