Skip to content

Commit 0248dda

Browse files
committed
Fix error: implicit conversion from float-string to int loses precision
Was deprecated in 8.1
1 parent 79898da commit 0248dda

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ InterBase: misc sql types (may take a while)
4646
$v_double = rand_number(18);
4747
$v_float = rand_number(7);
4848
$v_integer = rand_number(9,0);
49-
$v_smallint = rand_number(5) % 32767;
49+
$v_smallint = ((int)rand_number(5)) % 32767;
5050
$v_varchar = rand_str(10000);
5151

5252
ibase_query(

tests/006.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ InterBase: binding (may take a while)
4545
$v_float = rand_number(7);
4646
$v_integer = rand_number(9,0);
4747
$v_numeric = rand_number(4,2);
48-
$v_smallint = rand_number(5) % 32767;
48+
$v_smallint = ((int)rand_number(5)) % 32767;
4949
$v_varchar = rand_str(10000);
5050

5151
ibase_query("insert into test6
@@ -115,7 +115,7 @@ InterBase: binding (may take a while)
115115
$v_float = rand_number(7);
116116
$v_integer = rand_number(9,0);
117117
$v_numeric = rand_number(4,2);
118-
$v_smallint = rand_number(5) % 32767;
118+
$v_smallint = ((int)rand_number(5)) % 32767;
119119
$v_varchar = rand_str(10000);
120120

121121
/* clear table*/

tests/functions.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
srand((double)microtime()*1000000);
3+
srand(((int)(double)microtime()*1000000));
44

55
function out_table($table_name)
66
{

0 commit comments

Comments
 (0)