summaryrefslogtreecommitdiff
path: root/src/value.cpp
diff options
context:
space:
mode:
authorJasperVanEck <jaspergkurtz@gmail.com>2013-12-02 12:28:32 +0100
committerJasperVanEck <jaspergkurtz@gmail.com>2013-12-02 12:28:32 +0100
commit040f493080df2787557b891713d5f851ac78cae6 (patch)
tree00a848964c7191a18fa3d1af4042866c1edf18e7 /src/value.cpp
parentc97224558d022b5698fb000018f910f2499df1b4 (diff)
isCallable now works
Diffstat (limited to 'src/value.cpp')
-rw-r--r--src/value.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/value.cpp b/src/value.cpp
index 9d382f1..603508e 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -789,6 +789,15 @@ Value Value::exec(int argc, zval ***params)
*/
Type Value::type() const
{
+ // When the type should be a callable Z_TYPE_P returns objectType
+ // To circumvent this, we check whether _val is callable
+ char *func_name;
+ if(zend_is_callable(_val, 0, &func_name))
+ {
+ return callableType;
+ }
+
+ // return regular type
return (Type)Z_TYPE_P(_val);
}