PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pgsql/tests/80_bug24499.phpt ('Bug #24499 (Notice: Undefined property: stdClass::)')

Script

1: <?php
2:
3:
require_once('config.inc');
4:     
5:
$dbh = @pg_connect($conn_str);
6: if (!
$dbh) {
7:     die (
"Could not connect to the server");
8: }
9:
10: @
pg_query("DROP SEQUENCE id_id_seq");
11: @
pg_query("DROP TABLE id");
12:
pg_query("CREATE TABLE id (id SERIAL, t INT)");
13:
14: for (
$i=0$i<4$i++) {
15:     
pg_query("INSERT INTO id (t) VALUES ($i)");
16: }
17:
18: class 
Id
19:
{
20:     public 
$id;
21:
22:     public function 
getId()
23:     {
24:         global 
$dbh;
25:
26:         
$q  pg_query($dbh"SELECT id FROM id");
27:         
print_r(pg_fetch_array($q));
28:         
print_r(pg_fetch_array($q));
29:         
$id pg_fetch_object($q);
30:         
var_dump($id);
31:         return 
$id->id;
32:     }
33: }
34:
35:
$id = new Id();
36:
var_dump($id->getId());
37:
38:
pg_close($dbh);
39:
40: echo 
"Done\n";
41:
42:
?>
43:

Expected

Array
(
    [0] => 1
    [id] => 1
)
Array
(
    [0] => 2
    [id] => 2
)
object(stdClass)#%d (1) {
  ["id"]=>
  string(1) "3"
}
string(1) "3"
Done

Output

Warning: pg_query(): Query failed: ERROR:  relation "id" already exists in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 12

Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
LINE 1: INSERT INTO id (t) VALUES (0)
                        ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15

Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
LINE 1: INSERT INTO id (t) VALUES (1)
                        ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15

Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
LINE 1: INSERT INTO id (t) VALUES (2)
                        ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15

Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
LINE 1: INSERT INTO id (t) VALUES (3)
                        ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 26

Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 27

Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 28

Warning: pg_fetch_object() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 29
NULL

Notice: Trying to get property of non-object in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 31
NULL
Done

Diff

001+ Warning: pg_query(): Query failed: ERROR:  relation "id" already exists in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 12
002+ 
003+ Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
004+ LINE 1: INSERT INTO id (t) VALUES (0)
005+                         ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15
006+ 
007+ Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
008+ LINE 1: INSERT INTO id (t) VALUES (1)
009+                         ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15
010+ 
011+ Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
012+ LINE 1: INSERT INTO id (t) VALUES (2)
013+                         ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15
014+ 
015+ Warning: pg_query(): Query failed: ERROR:  column "t" of relation "id" does not exist
016+ LINE 1: INSERT INTO id (t) VALUES (3)
001- Array
002- (
003-     [0] => 1
004-     [id] => 1
005- )
006- Array
007- (
008-     [0] => 2
009-     [id] => 2
010- )
011- object(stdClass)#%d (1) {
012-   ["id"]=>
013-   string(1) "3"
014- }
015- string(1) "3"
016- Done
017+                         ^ in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 15
018+ 
019+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 26
020+ 
021+ Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 27
022+ 
023+ Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 28
024+ 
025+ Warning: pg_fetch_object() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 29
026+ NULL
027+ 
028+ Notice: Trying to get property of non-object in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug24499.php on line 31
029+ NULL
030+ Done

 

Generated at Mon, 27 Nov 2017 05:04:32 +0000 (13 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.