Skip to content

PDO::setAttribute(ATTR_ERRMODE, non-int) returns true instead of throwing TypeError #326

Closed

Description

@blacktrs

Summary

PDO::setAttribute(ATTR_ERRMODE, non-int) returns true instead of throwing TypeError.

Repro

<?php
try { $db = new PDO('sqlite::memory:'); var_dump($db->setAttribute(PDO::ATTR_ERRMODE, 'x')); } catch (Throwable $e) { echo get_class($e), ': ', $e->getMessage(), "\n"; }

Expected (php)

TypeError: Attribute value must be of type int for selected attribute, string given

Actual (manticore ea11f898, Darwin arm64)

bool(true)

Tracking

Known-bug repro: tests/aot/repro/wrong/pdo_errmode_nonint_type_error.php — bash tests/aot/xfail.sh -k pdo_errmode_nonint_type_error reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    wrong-answer
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions