Changeset 570
- Timestamp:
- 06/25/08 10:13:18 (5 months ago)
- Files:
-
- trunk/rphp/runtime/var-test.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rphp/runtime/var-test.cpp
r569 r570 59 59 int operator()(const RPHP::p3state &i) const 60 60 { 61 if (i >= 0) {62 std::cout << "i see a bool" << std::endl;63 }64 else {65 std::cout << "i see a null" << std::endl;66 }61 if (i == RPHP::Null) { 62 std::cout << "i see a null" << std::endl; 63 } 64 else { 65 std::cout << "i see a bool" << std::endl; 66 } 67 67 return i; 68 68 } … … 105 105 pvartype operator()(const double &i) const 106 106 { 107 return PVAR_DOUBLE;107 return PVAR_DOUBLE; 108 108 } 109 109 110 110 pvartype operator()(const std::string &str) const 111 111 { 112 return PVAR_STRING;112 return PVAR_STRING; 113 113 } 114 114 115 115 pvartype operator()(const php_hash &h) const 116 116 { 117 return PVAR_HASH;117 return PVAR_HASH; 118 118 } 119 119 120 120 pvartype operator()(const RPHP::p3state &h) const 121 121 { 122 return (h >= 0) ? PVAR_BOOL : PVAR_NULL;122 (h == RPHP::Null) ? PVAR_NULL : PVAR_BOOL; 123 123 } 124 124 … … 143 143 void operator()(const double &i) const 144 144 { 145 // nothing, already numeric145 // nothing, already numeric 146 146 } 147 147 148 148 void operator()(const php_hash &h) const 149 149 { 150 var = (long)h.getSize();150 var = (long)h.getSize(); 151 151 } 152 152 153 153 void operator()(const RPHP::p3state &h) const 154 154 { 155 (h <= 0) ? var = 0l : var = 1l;155 (h == RPHP::True) ? var = 1l : var = 0l; 156 156 } 157 157 158 158 void operator()(const long &a) const { 159 // Do nothing - already correct type159 // Do nothing - already correct type 160 160 } 161 161 };
