PHP extension for V8 JavaScript engine
I'm excited to announce that starting from this release documentation is available at https://php-v8.readthedocs.io.
Read The Docs is awesome place to host documentation and Sphinx would help to create decent documentation. Contributors welcomed!
This is the last version that supports PHP 7.1. For all next versions PHP >= 7.2 required.
BC-breaking changes:
ScriptCompiler
cache optionsPromiseObject
ValueObject::isBigInt64Array()
and ValueObject::isBigUint64Array
methodsNon-breaking changes:
HeapStatistics
ObjectValue::GetOwnPropertyNames
and `ObjectValue::GetPropertyNamesThis release brings stability and improvements. It contains some minor BC-breaking changes which should not affect general public. See full change log below for details
Changelog:
*
- BC-breaking changes
*
require libv8 >= 6.4.6;*
remove UnboundScript::kNoScriptId
const and return null
in getId()
on no data*
change ScriptCompiler::cachedDataVersionTag(): int
method name and return type to be ScriptCompiler::getCachedDataVersionTag(): float
;*
remove StartupData::getRawSize()
method;CallbackInfoInterface
;{Isolate,Context}::within()
as optimization solution;StartupData::isRejected()
;This release introduces many major changes to public API and breaks BC for the sake of more solid and stable API in a further versions.
PLEASE READ:
Maintaining this project takes significant amount of time and efforts. If you like my work and want to show your appreciation, please consider supporting me at https://www.patreon.com/pinepain.
Changes:
$value
param in Template::set()
, #36;final
, #39 ;HeapStatistics
methods to match PSR-2, #38;V8\Exception
class and it methods, #33;FunctionObject::getScriptId()
method;NULL
instead, #40;ScriptOriginOptions
to use bit field, #42;ScriptOrigin::is*()
methods, #61;Value
stub;dotAll
flag, #54;RegExpObject\Flags
constants under RegExpObject
, #64;CompileOptions
constants under ScriptCompiler
, #65;Isolate::MemoryPressureNotification()
support, #57;StackFrame::isWasm()
, #53;CallbackInfo
, #67;ObjectTemplate
, #58;StartupData::warmUpSnapshotDataBlob()
, #59;JSON
class support, #56;Message::getErrorLevel()
method, #52;SymbolValue
methods, #41;TryCatch
methods, #41;PrimitiveValue::value()
abstract method;Isolate::SetRAILMode()
, #60;See https://github.com/pinepain/php-v8/issues/43#issuecomment-333329225 for details
This is the last release that supports PHP 7.0.
Changes:
This release extends and clarify existent API and does not introduce any BC-breaking changes.
Changes list:
V8\Exception::*Error()
return type to V8\ObjectValue
as the only possible type;V8\Isolate::ThrowException()
.Changes to public API and other important changes which may affect end-user:
Changes to public API and other important changes which may affect end-user:
Value()
method on all V8\Primitive
values;V8\FunctionObject::NewInstance()
;This release introduces separate representation for undefined
value and fixes some bugs. Please, see change list below for more details.
*
- BC-breaking or potentially BC-breaking changes
Changes to public API and other important changes which may affect end-user:
*
Make V8\Isolate::ThrowException()
method void;*
Remove non-documented V8Isolate::ContextDisposedNotification();*
Make V8\Value
, V8\PrimitiveValue
and V8\NameValue
abstract;V8\Isolate
time limit affects js runtime only;undefined
value - V8UndefenedValue
;V8\Isolate
;This release adds low-level optimizations, simplify some internal methods and fix few bugs. For more details see change list below.
As of this release, V8 >= 6.0.45 required.
*
- BC-breaking or potentially BC-breaking changes
Changes to public API and other important changes which may affect end-user:
V8\Value::InstanceOf()
method;V8\ObjectValue::SetNativeDataProperty()
method;V8\PropertyFilter
, V8\KeyCollectionMode
and V8\IndexFilter
enums;V8\ObjectValue::Get{Property,OwnProperty}Names()
;V8\SymbolValue
;StackFrame
with valid type;V8\StringValue
constructor in stubs;*
Add V8\ConstructorBehavior
and support for it in V8\FunctionTemplate
constructor;*
Add signature support in V8\FunctionTemplate
constructor via $receiver;*
Add signature support to Template:SetNativeDataProperty()
and ObjectTemplate::SetAccessor()
via $receiver
;*
Remove require $isolate
parameter from V8\Value::TypeOf()
;*
Remove deprecated V8\Context::EstimatedSize() method;*
Remove deprecated V8\StackTrace\StackTraceOptions
;*
Remove deprecated V8\StackTrace::AsArray()
;*
Require Context explicitly in V8\Isolate::ThrowException()
;*
Rename V8\Exceptions\GenericException
to V8\Exceptions\Exception
;*
Rename V8\Exceptions\AbstractResourceLimitException
to V8\Exceptions\ResourceLimitException
;*
Check whether returned context is empty in V8\Isolate\GetEnteredContext()
instead of checking InContext()
;This release adds low-level optimizations, simplify some internal methods and fix few bugs. For more details see change list below.
As of this release, V8 >= 5.9.5 required.
*
- BC-breaking or potentially BC-breaking changes
Changes to public API and other important changes which may affect end-user:
*
Replace V8\Isolate::GetCurrentContext
with V8\Isolate::GetEnteredContext()
;*
Remove V8\ObjectValue::CreationContext()
, use V8\ObjectValue::GetContext()
;V8\PropertyCallbackInfo::ShouldThrowOnError()
method;V8\FunctionCallbackInfo::NewTarget()
method;V8\ReturnValue
now explicitly holds isolate and context which could be accessed outside of calling context, though ReturnValue::{Get,Set}
could be accessed only within calling context as before;V8\FunctionCallbackInfo
and V8\PropertyCallbackInfo
, now they are fully build, properly stores owning isolate and context and could be safely used outside calling scope;V8\ScriptCompiler::CompileFunctionInContext()
invoked with arguments or arguments and context extensions;die()
, exit()
, uncaught exception) from isolate which entered multiple time or from multiple nested isolates (quite rare use case).V8\Exceptions\ValueException
to stubs. It support was in extension for ages but for some reason it was missed from stubs.$global_template
and $global_object
private props from V8\Context
. They were never exposed to end-user anyway.