Skip to content

Commit cbe9c1a

Browse files
committed
Added float cast error
1 parent 6c3f246 commit cbe9c1a

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

php/float_cast_error.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
$n = (0.1 + 0.7) * 10;
3+
4+
echo $n;
5+
echo "\n";
6+
echo (int)($n);
7+
echo "\n";
8+
if ($n == 8){
9+
echo "8 == 8";
10+
} else {
11+
echo "8 != 8";
12+
}
13+
?>

php/test.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ $Error.clear()
1212
php "$PSScriptRoot\clockhands.php" |
1313
Compare-Object (Get-Content "$PSScriptRoot\..\test\clockhands_expected") |
1414
Assert-MatchTests &&
15+
php "$PSScriptRoot\float_cast_error.php" &&
1516
php "$PSScriptRoot\hello_world.php" &&
1617
php "$PSScriptRoot\html_escaping.php" &&
18+
php "$PSScriptRoot\integer_overflow.php" &&
1719
php "$PSScriptRoot\ternary_madness.php" &&
1820
php "$PSScriptRoot\triples.php" |
1921
Compare-Object (Get-Content "$PSScriptRoot\..\test\triple_expected") |

0 commit comments

Comments
 (0)