type->value ?? 'NULL') . "\n"; echo "Auth type is null: " . (is_null($auth->type) ? 'YES' : 'NO') . "\n\n"; // Test 2: Create ClientOptions with auth echo "Test 2: ClientOptions with auth\n"; $options = new ClientOptions( timeout: 10, auth: $auth ); var_dump($options->auth); echo "Options auth type: " . ($options->auth->type->value ?? 'NULL') . "\n"; echo "Options auth type is null: " . (is_null($options->auth->type) ? 'YES' : 'NO') . "\n\n"; // Test 3: ClientOptions with() method echo "Test 3: ClientOptions with() method\n"; $baseOptions = new ClientOptions(timeout: 10); $newOptions = $baseOptions->with(['auth' => $auth]); var_dump($newOptions->auth); echo "New options auth type: " . ($newOptions->auth->type->value ?? 'NULL') . "\n"; echo "New options auth type is null: " . (is_null($newOptions->auth->type) ? 'YES' : 'NO') . "\n\n"; // Test 4: Check if readonly classes preserve properties echo "Test 4: Readonly class property preservation\n"; $options1 = new ClientOptions(timeout: 10, auth: $auth); $options2 = $options1; // Assignment echo "Are they the same object? " . (($options1 === $options2) ? 'YES' : 'NO') . "\n"; echo "Options1 auth type: " . ($options1->auth->type->value ?? 'NULL') . "\n"; echo "Options2 auth type: " . ($options2->auth->type->value ?? 'NULL') . "\n";