diff --git a/Tests/02types-xls.php b/Tests/02types-xls.php index 16e7ee9b..b5249988 100644 --- a/Tests/02types-xls.php +++ b/Tests/02types-xls.php @@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean'); $objPHPExcel->getActiveSheet()->setCellValue('B8', 'False'); $objPHPExcel->getActiveSheet()->setCellValue('C8', false); -$dateTimeNow = gmmktime(); +$dateTimeNow = time(); $objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time'); $objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); @@ -122,6 +122,12 @@ $objWriter->save(str_replace('.php', '.xls', __FILE__)); echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', __FILE__) , PHP_EOL; +echo date('H:i:s') , " Reload workbook from saved file" , PHP_EOL; +$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xls', __FILE__)); + +var_dump($objPHPExcel->getActiveSheet()->toArray()); + + // Echo memory peak usage echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; diff --git a/Tests/02types.php b/Tests/02types.php index 2c5467c4..a6a31364 100644 --- a/Tests/02types.php +++ b/Tests/02types.php @@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean'); $objPHPExcel->getActiveSheet()->setCellValue('B8', 'False'); $objPHPExcel->getActiveSheet()->setCellValue('C8', false); -$dateTimeNow = gmmktime(); +$dateTimeNow = time(); $objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time'); $objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); @@ -122,6 +122,12 @@ $objWriter->save(str_replace('.php', '.xlsx', __FILE__)); echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL; +echo date('H:i:s') , " Reload workbook from saved file" , PHP_EOL; +$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xlsx', __FILE__)); + +var_dump($objPHPExcel->getActiveSheet()->toArray()); + + // Echo memory peak usage echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;