From 19223f8527ef1c0d36cf8b40b9f8d093ea702ca5 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Jun 2017 07:39:05 -0700 Subject: Added better null helpers to libbu++/php --- php/phpgats2.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'php/phpgats2.php') diff --git a/php/phpgats2.php b/php/phpgats2.php index effaa78..f97bd89 100644 --- a/php/phpgats2.php +++ b/php/phpgats2.php @@ -237,7 +237,11 @@ function _phpgats2_writeDictionary( $d ) function _phpgats2__write( $unknown ) { - if( is_bool( $unknown ) ) + if( is_null( $unknown ) ) + { + return 'n'; + } + else if( is_bool( $unknown ) ) { return _phpgats2_writeBoolean( $unknown ); } @@ -462,7 +466,10 @@ function _phpgats2_parseMaster( $str_data, &$offset, $dbg=0 ) case '0': //echo "false\n"; return false; - break; + break; + case 'n': + return null; + break; default: //echo "str:"; $obj = _phpgats2_parseString( $str_data, $offset, $dbg ); -- cgit v1.2.3