diff options
author | Mike Buland <mbuland@penny-arcade.com> | 2017-06-05 07:39:05 -0700 |
---|---|---|
committer | Mike Buland <mbuland@penny-arcade.com> | 2017-06-05 07:39:05 -0700 |
commit | 19223f8527ef1c0d36cf8b40b9f8d093ea702ca5 (patch) | |
tree | d59222d22d96318948b52329e2ee4ec0e0745d1a /php/phpgats2.php | |
parent | ae3649ec44e9c08dac7553031573ea52c1dfdd82 (diff) | |
download | libgats-19223f8527ef1c0d36cf8b40b9f8d093ea702ca5.tar.gz libgats-19223f8527ef1c0d36cf8b40b9f8d093ea702ca5.tar.bz2 libgats-19223f8527ef1c0d36cf8b40b9f8d093ea702ca5.tar.xz libgats-19223f8527ef1c0d36cf8b40b9f8d093ea702ca5.zip |
Added better null helpers to libbu++/php
Diffstat (limited to '')
-rw-r--r-- | php/phpgats2.php | 11 |
1 files changed, 9 insertions, 2 deletions
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 ) | |||
237 | 237 | ||
238 | function _phpgats2__write( $unknown ) | 238 | function _phpgats2__write( $unknown ) |
239 | { | 239 | { |
240 | if( is_bool( $unknown ) ) | 240 | if( is_null( $unknown ) ) |
241 | { | ||
242 | return 'n'; | ||
243 | } | ||
244 | else if( is_bool( $unknown ) ) | ||
241 | { | 245 | { |
242 | return _phpgats2_writeBoolean( $unknown ); | 246 | return _phpgats2_writeBoolean( $unknown ); |
243 | } | 247 | } |
@@ -462,7 +466,10 @@ function _phpgats2_parseMaster( $str_data, &$offset, $dbg=0 ) | |||
462 | case '0': | 466 | case '0': |
463 | //echo "false\n"; | 467 | //echo "false\n"; |
464 | return false; | 468 | return false; |
465 | break; | 469 | break; |
470 | case 'n': | ||
471 | return null; | ||
472 | break; | ||
466 | default: | 473 | default: |
467 | //echo "str:"; | 474 | //echo "str:"; |
468 | $obj = _phpgats2_parseString( $str_data, $offset, $dbg ); | 475 | $obj = _phpgats2_parseString( $str_data, $offset, $dbg ); |