This will only apply the appropriate escaping and such appropriate for embedding the PHP value into an SQL statement.
It does (by default) check for nulls when the column is marked NOT NULL, and it will complain about trying to convert strings for an integer column (floats will be truncated).
Beyond the barest checking of syntax, however, it does NOT verify that the given value is a legitimate value for the column type.
<?php
foreach([-1234,
1234,
0,
32767,
-32768,
32768, 45.8, 400000, ] as $smallint)
{
$tmp = ['smallint' => $smallint];
$vals = pg_convert($dbconn, 'smallints', ['smallint' => $smallint]);
echo $vals['"smallint"'],"\n"; }
foreach(['a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11',
'a0eebc999c0b4ef8bb6d6bb9bd380a11',
'{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}',
'Invalid Not-a-UUID',
'{a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}',
'a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11',
] as $uuid)
{
$tmp = ['uuid' => $uuid];
$vals = pg_convert($dbconn, 'uuids', ['uuid' => $uuid]);
echo $vals['"uuid"'],"\n";
}
?>
All of the above data values will be "converted" - even the invalid ones - without complaint.