Skip to content

Commit a4647c2

Browse files
committed
API updates to include: setAverageObjectSize() as well as default array
values.
1 parent 5c3b447 commit a4647c2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/V8Js.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class V8Js
1717
* @param bool $report_uncaught_exceptions
1818
* @param string $snapshot_blob
1919
*/
20-
public function __construct($object_name = 'PHP', array $variables = null, array $extensions = null, $report_uncaught_exceptions = true, $snapshot_blob = null)
20+
public function __construct($object_name = 'PHP', array $variables = [], array $extensions = [], $report_uncaught_exceptions = true, $snapshot_blob = null)
2121
{}
2222

2323
/**
@@ -99,6 +99,16 @@ public function setTimeLimit($limit)
9999
public function setMemoryLimit($limit)
100100
{}
101101

102+
/**
103+
* Set the average object size (in bytes) for this V8Js object.
104+
* V8's "amount of external memory" is adjusted by this value for every exported object. V8 triggers a garbage
105+
* collection once this totals to 192 MB.
106+
*
107+
* @param int $average_object_size
108+
*/
109+
public function setAverageObjectSize($average_object_size)
110+
{}
111+
102112
/**
103113
* Returns uncaught pending exception or null if there is no pending exception.
104114
*

0 commit comments

Comments
 (0)