| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -17,5 +17,3 @@ function _set_lc_messages($conn, $lc_messages = 'C') | |
|
|
||
| return true; | ||
| } | ||
|
|
||
| ?> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --TEST-- | ||
| pg_fetch_object() with abstract class name | ||
| --EXTENSIONS-- | ||
| pgsql | ||
| --SKIPIF-- | ||
| <?php | ||
| include("skipif.inc"); | ||
| ?> | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| interface I {} | ||
|
|
||
| abstract class C {} | ||
|
|
||
| enum E { | ||
| case A; | ||
| } | ||
|
|
||
| include "config.inc"; | ||
| $table_name = "pg_fetch_object_abstract_class"; | ||
| $db = pg_connect($conn_str); | ||
| pg_query($db, "CREATE TABLE {$table_name} (a integer, b text)"); | ||
| pg_query($db, "INSERT INTO {$table_name} VALUES(0, 'ABC')"); | ||
|
|
||
| $sql = "SELECT * FROM $table_name WHERE a = 0"; | ||
|
|
||
| try { | ||
| $result = pg_query($db, $sql); | ||
| var_dump(pg_fetch_object($result, NULL, 'I')); | ||
| } catch(Throwable $e) { | ||
| echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
| } | ||
|
|
||
| try { | ||
| $result = pg_query($db, $sql); | ||
| var_dump(pg_fetch_object($result, NULL, 'C')); | ||
| } catch(Throwable $e) { | ||
| echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
| } | ||
|
|
||
| try { | ||
| $result = pg_query($db, $sql); | ||
| var_dump(pg_fetch_object($result, NULL, 'E')); | ||
| } catch(Throwable $e) { | ||
| echo $e::class, ': ', $e->getMessage(), PHP_EOL; | ||
| } | ||
|
|
||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitynit: would it be possible to add the closing tag ?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityMight also be the reason windows is confused
Sorry, something went wrong.
All reactions
|
||
| ?> | ||
| --CLEAN-- | ||
| <?php | ||
| include('config.inc'); | ||
| $db = @pg_connect($conn_str); | ||
| @pg_query($db, "DROP TABLE IF EXISTS pg_fetch_object_abstract_class cascade"); | ||
| ?> | ||
| --EXPECT-- | ||
| Error: Cannot instantiate interface I | ||
| Error: Cannot instantiate abstract class C | ||
| Error: Cannot instantiate enum E | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityMaybe try without this last PHP_EOL wdyt ?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.