Releases: phpv8/php-v8
Sync with V8 upstream and new features
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:
- Upgrade v8 version to 6.6.313
- Remove deprecated and non-working
ScriptCompilercache options - Rework
PromiseObject - Add
ValueObject::isBigInt64Array()andValueObject::isBigUint64Arraymethods
Non-breaking changes:
- Add number of native and detached contexts to
HeapStatistics - Add support to produce code cache
- Add ScriptCompiler::OPTION_EAGER_COMPILE option
- Add support for integer->strings for
ObjectValue::GetOwnPropertyNamesand `ObjectValue::GetPropertyNames - Add {Template,ObjectValue}:setLazyDataProperty() method
Bug fixes and improvements
This 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;*removeUnboundScript::kNoScriptIdconst and returnnullingetId()on no data*changeScriptCompiler::cachedDataVersionTag(): intmethod name and return type to beScriptCompiler::getCachedDataVersionTag(): float;*removeStartupData::getRawSize()method;- fix segfault when invalid startup data passed to isolate;
- fix external exception lost when it has refcount 1;
- change script compiler version tag generation to take into account changes to extension internals;
- add
CallbackInfoInterface; - add support for ScriptCompiler::kProduceFullCodeCache;
- add
{Isolate,Context}::within()as optimization solution; - add
StartupData::isRejected(); - add docs skeleton.
Upgrade extension API
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:
- Drop PHP 7.0 support, #30;
- Add typehint for
$valueparam inTemplate::set(), #36; - Rename constants to match PSR-2 convention, #34;
- Make enum classes with constants
final, #39 ; - Rename
HeapStatisticsmethods to match PSR-2, #38; - Rename
V8\Exceptionclass and it methods, #33; - Add
FunctionObject::getScriptId()method; - Remove no-data constants and use
NULLinstead, #40; - Refactor
ScriptOriginOptionsto use bit field, #42; - Remove redundant
ScriptOrigin::is*()methods, #61; - Add missed method to
Valuestub; - Fix improperly adjusted external allocated memory on weak callback call;
- Add Proxy and Promise builtin support, #55;
- Add support for regexp
dotAllflag, #54; - Move
RegExpObject\Flagsconstants underRegExpObject, #64; - Move
CompileOptionsconstants underScriptCompiler, #65; - Add
Isolate::MemoryPressureNotification()support, #57; - Require libv8 >= 6.3.163;
- Add
StackFrame::isWasm(), #53; - Get rid of
CallbackInfo, #67; - Add immutable prototype chains to
ObjectTemplate, #58; - Add
StartupData::warmUpSnapshotDataBlob(), #59; - Add missed
JSONclass support, #56; - Add
Message::getErrorLevel()method, #52; - Rename
SymbolValuemethods, #41; - Rename
TryCatchmethods, #41; - Add missed
PrimitiveValue::value()abstract method; - Add
Isolate::SetRAILMode(), #60; - Fix improperly internally constructed RAILMode enum class, #60.
See #43 (comment) for details
Refactor methods name to follow PSR-2 camelCase convention
This is the last release that supports PHP 7.0.
Changes:
- refactor method names to follow PSR-2 camelCase convention;
Improve exceptions api
This release extends and clarify existent API and does not introduce any BC-breaking changes.
Changes list:
- Change
V8\Exception::*Error()return type toV8\ObjectValueas the only possible type; - Add external exception wiring option to
V8\Isolate::ThrowException().
Fix segfaults on unclean shutdown
Changes to public API and other important changes which may affect end-user:
- Fix segfaults on unclean shutdown
- Require v8 >= 6.1.170
Add Value() metod to all Primitive values and fix bugs
Changes to public API and other important changes which may affect end-user:
- Enforce
Value()method on allV8\Primitivevalues; - Fix segfault when zero args passed to
V8\FunctionObject::NewInstance();
Improve JS primitive types handling and bug fixes
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:
*MakeV8\Isolate::ThrowException()method void;*Remove non-documented V8Isolate::ContextDisposedNotification();*MakeV8\Value,V8\PrimitiveValueandV8\NameValueabstract;V8\Isolatetime limit affects js runtime only;- Introduce separate class for
undefinedvalue -V8UndefenedValue; - Fix V8\Tempalte::Set() to do not accept non-primitive values;
- Remove all private properties from
V8\Isolate;
Improve API
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:
- Raise libv8 required version to 6.0.45;
- Add
V8\Value::InstanceOf()method; - Add
V8\ObjectValue::SetNativeDataProperty()method; - Add
V8\PropertyFilter,V8\KeyCollectionModeandV8\IndexFilterenums; - Add property filtering support to
V8\ObjectValue::Get{Property,OwnProperty}Names(); - Consistently expose all well-known symbols on
V8\SymbolValue; - Setting boolean props on
StackFramewith valid type; - Remove non-working and non-supporting $attributes argument from
V8\StringValueconstructor in stubs; *AddV8\ConstructorBehaviorand support for it inV8\FunctionTemplateconstructor;*Add signature support inV8\FunctionTemplateconstructor via $receiver;*Add signature support toTemplate:SetNativeDataProperty()andObjectTemplate::SetAccessor()via$receiver;*Remove require$isolateparameter fromV8\Value::TypeOf();*Remove deprecated V8\Context::EstimatedSize() method;*Remove deprecatedV8\StackTrace\StackTraceOptions;*Remove deprecatedV8\StackTrace::AsArray();*Require Context explicitly inV8\Isolate::ThrowException();*RenameV8\Exceptions\GenericExceptiontoV8\Exceptions\Exception;*RenameV8\Exceptions\AbstractResourceLimitExceptiontoV8\Exceptions\ResourceLimitException;*Check whether returned context is empty inV8\Isolate\GetEnteredContext()instead of checkingInContext();
Cleanups, optimizations and fixes
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:
*ReplaceV8\Isolate::GetCurrentContextwithV8\Isolate::GetEnteredContext();*RemoveV8\ObjectValue::CreationContext(), useV8\ObjectValue::GetContext();- Add
V8\PropertyCallbackInfo::ShouldThrowOnError()method; - Add
V8\FunctionCallbackInfo::NewTarget()method; V8\ReturnValuenow explicitly holds isolate and context which could be accessed outside of calling context, thoughReturnValue::{Get,Set}could be accessed only within calling context as before;- Fix potential problems with
V8\FunctionCallbackInfoandV8\PropertyCallbackInfo, now they are fully build, properly stores owning isolate and context and could be safely used outside calling scope; - Fix leak when
V8\ScriptCompiler::CompileFunctionInContext()invoked with arguments or arguments and context extensions; - Fix segfault under when abruptly exiting (
die(),exit(), uncaught exception) from isolate which entered multiple time or from multiple nested isolates (quite rare use case). - Add
V8\Exceptions\ValueExceptionto stubs. It support was in extension for ages but for some reason it was missed from stubs. - Remove
$global_templateand$global_objectprivate props fromV8\Context. They were never exposed to end-user anyway.