3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { new PDO('открываем для себя наследование', 'логин', 'пароль'); } catch (Exception $e) { echo $e; }
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in /in/7cpaV:4 Stack trace: #0 /in/7cpaV(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', '\xD0\xBB\xD0\xBE\xD0\xB3\xD0\xB8\xD0\xBD', Object(SensitiveParameterValue)) #1 {main}
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in /in/7cpaV:4 Stack trace: #0 /in/7cpaV(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', '\xD0\xBB\xD0\xBE\xD0\xB3\xD0\xB8\xD0\xBD', Object(SensitiveParameterValue)) #1 {main}
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in /in/7cpaV:4 Stack trace: #0 /in/7cpaV(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', '\xD0\xBB\xD0\xBE\xD0\xB3\xD0\xB8\xD0\xBD', '\xD0\xBF\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8C') #1 {main}
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
PDOException: invalid data source name in /in/7cpaV:4 Stack trace: #0 /in/7cpaV(4): PDO->__construct('\xD0\xBE\xD1\x82\xD0\xBA\xD1\x80\xD1\x8B\xD0\xB2\xD0\xB0\xD0...', '\xD0\xBB\xD0\xBE\xD0\xB3\xD0\xB8\xD0\xBD', '\xD0\xBF\xD0\xB0\xD1\x80\xD0\xBE\xD0\xBB\xD1\x8C') #1 {main}

preferences:
234.46 ms | 402 KiB | 182 Q