@@ -1424,9 +1424,10 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
1424
1424
}
1425
1425
pgsql = (PGconn * ) le -> ptr ;
1426
1426
#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS
1427
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 7.2 ) {
1427
+ /* consider to use php_version_compare() here */
1428
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 7.2 ) {
1428
1429
#else
1429
- if (atof (PG_VERSION ) >= 7.2 ) {
1430
+ if (zend_strtod (PG_VERSION , NULL ) >= 7.2 ) {
1430
1431
#endif
1431
1432
pg_result = PQexec (pgsql , "RESET ALL;" );
1432
1433
PQclear (pg_result );
@@ -5326,9 +5327,10 @@ PHP_FUNCTION(pg_get_notify)
5326
5327
add_index_string (return_value , 0 , pgsql_notify -> relname );
5327
5328
add_index_long (return_value , 1 , pgsql_notify -> be_pid );
5328
5329
#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS
5329
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 9.0 ) {
5330
+ /* consider to use php_version_compare() here */
5331
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 9.0 ) {
5330
5332
#else
5331
- if (atof (PG_VERSION ) >= 9.0 ) {
5333
+ if (zend_strtod (PG_VERSION ) >= 9.0 , NULL ) {
5332
5334
#endif
5333
5335
#if HAVE_PQPARAMETERSTATUS
5334
5336
add_index_string (return_value , 2 , pgsql_notify -> extra );
@@ -5339,9 +5341,10 @@ PHP_FUNCTION(pg_get_notify)
5339
5341
add_assoc_string (return_value , "message" , pgsql_notify -> relname );
5340
5342
add_assoc_long (return_value , "pid" , pgsql_notify -> be_pid );
5341
5343
#if HAVE_PQPROTOCOLVERSION && HAVE_PQPARAMETERSTATUS
5342
- if (PQprotocolVersion (pgsql ) >= 3 && atof (PQparameterStatus (pgsql , "server_version" )) >= 9.0 ) {
5344
+ /* consider to use php_version_compare() here */
5345
+ if (PQprotocolVersion (pgsql ) >= 3 && zend_strtod (PQparameterStatus (pgsql , "server_version" ), NULL ) >= 9.0 ) {
5343
5346
#else
5344
- if (atof (PG_VERSION ) >= 9.0 ) {
5347
+ if (zend_strtod (PG_VERSION , NULL ) >= 9.0 ) {
5345
5348
#endif
5346
5349
#if HAVE_PQPARAMETERSTATUS
5347
5350
add_assoc_string (return_value , "payload" , pgsql_notify -> extra );
0 commit comments