3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { new PDO('открываем для себя наследование', 'login', 'password'); } catch (Exception $e) { echo $e; }
based on 7cpaV
Output for 8.0.0alpha1 - beta3
PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in /in/vicnI:4 Stack trace: #0 /in/vicnI(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', 'login', 'password') #1 {main}
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.21, 7.4.0 - 7.4.10
PDOException: invalid data source name in /in/vicnI:4 Stack trace: #0 /in/vicnI(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', 'login', 'password') #1 {main}