From e42643d43983226fe8d7f9ade57c702355ae67f4 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 4 Feb 2018 04:33:25 +0900 Subject: [PATCH] =?UTF-8?q?toInt=EC=97=90=20=EA=B0=95=EC=A0=9C=20=EB=B3=80?= =?UTF-8?q?=ED=99=98=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80(=3Dintval?= =?UTF-8?q?=EC=97=90=20null=EB=A7=8C=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/twe/lib.php b/twe/lib.php index 98b27f45..7f54728f 100644 --- a/twe/lib.php +++ b/twe/lib.php @@ -207,7 +207,7 @@ function PrintElapsedTime() { * * @return int|null */ -function toInt($val){ +function toInt($val, $force=false){ if($val === null){ return null; } @@ -217,7 +217,13 @@ function toInt($val){ if(is_numeric($val)){ return intval($val);// } + if($val === 'NULL' || $val === 'null'){ + return null; + } + if($force){ + return intval($val); + } throw new InvalidArgumentException('올바르지 않은 타입형 :'.$val); }