diff --git a/extension.cpp b/extension.cpp index 36e7140..b80d984 100644 --- a/extension.cpp +++ b/extension.cpp @@ -51,14 +51,14 @@ extern "C" { Php::Class context("JS\\Context"); // properties can be assigned - context.method("assign", &JS::Context::assign, { + context.method<&JS::Context::assign>("assign", { Php::ByVal("name", Php::Type::String, true), Php::ByVal("value", Php::Type::Null, true), Php::ByVal("attribute", Php::Type::Numeric, false) }); // add a method to execute some script - context.method("evaluate", &JS::Context::evaluate, { + context.method<&JS::Context::evaluate>("evaluate", { Php::ByVal("script", Php::Type::String, true), Php::ByVal("timeout", Php::Type::Numeric, false) }); diff --git a/value.cpp b/value.cpp index 8152fea..e4a5649 100644 --- a/value.cpp +++ b/value.cpp @@ -92,6 +92,10 @@ v8::Handle value(const Php::Value &input) case Php::Type::Callable: result = v8::FunctionTemplate::New(Isolate::get(), callback, Handle(input))->GetFunction(); break; case Php::Type::Array: result = Array(input); break; default: + // php 7 does not return the Bool type anymore, but rather True and False + // types, which would not compile with our legacy code, so we check if it + // is boolean here again, using a function that works identically for both + if (input.isBool()) result = v8::Boolean::New(Isolate::get(), input); break; } }