Skip to content

Commit c4928c2

Browse files
committed
fixed issue #63 relating to writing of NULL values
1 parent 63ae657 commit c4928c2

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

tests/056.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ float(434324)
3434
string(6) "string"
3535
string(8) "fsdfasDF"
3636
string(4) "NULL"
37-
string(0) ""
37+
NULL
3838
string(6) "string"
3939
string(0) ""
4040
OK

tests/write_read_row_bug.phpt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
A bug with using readRow/writeRow combination to handle NULL values
3+
--SKIPIF--
4+
<?php if (!extension_loaded("excel")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
$book = new ExcelBook();
8+
$ws = $book->addSheet("foo");
9+
10+
$row = array('a', 'b', 'c', NULL, 1, 2, 3);
11+
var_dump(
12+
$ws->writeRow(1, $row),
13+
$ws->readRow(1)
14+
);
15+
?>
16+
--EXPECT--
17+
bool(true)
18+
array(7) {
19+
[0]=>
20+
string(1) "a"
21+
[1]=>
22+
string(1) "b"
23+
[2]=>
24+
string(1) "c"
25+
[3]=>
26+
NULL
27+
[4]=>
28+
float(1)
29+
[5]=>
30+
float(2)
31+
[6]=>
32+
float(3)
33+
}

0 commit comments

Comments
 (0)