diff --git a/src/extensions/DatatypeTrait.php b/src/extensions/DatatypeTrait.php index 9323a2f..ce380c9 100644 --- a/src/extensions/DatatypeTrait.php +++ b/src/extensions/DatatypeTrait.php @@ -43,6 +43,8 @@ trait DatatypeTrait { * Check data type foreach Column * Check data type for each column and returns the most commonly. * + * Requires PHP >= 5.5 + * * @access public * * @uses getDatatypeFromString diff --git a/tests/methods/ParseTest.php b/tests/methods/ParseTest.php index 07eb3b7..d48435f 100644 --- a/tests/methods/ParseTest.php +++ b/tests/methods/ParseTest.php @@ -137,6 +137,12 @@ class ParseTest extends TestCase * @depends testSepRowAutoDetection */ public function testGetColumnDatatypes() { + if (!function_exists('array_column')) { + // getDatatypes requires array_column, but that + // function is only available in PHP >= 5.5 + return; + } + $this->csv->auto(__DIR__ . '/fixtures/datatype.csv'); $this->csv->getDatatypes(); $expected = [