We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8cd90c commit f2e9b23Copy full SHA for f2e9b23
1 file changed
src/Kernel/Mnemonics/_anewarray.php
@@ -15,13 +15,25 @@ final class _anewarray implements OperationInterface
15
*/
16
public function execute(): void
17
{
18
- // 配列のサイズを調べる (PHPでは不要なので実行するだけ)
+ // Current class index for Constant Pool
19
$this->readUnsignedShort();
20
21
- // 空の配列を渡す (nullで埋める)
22
- $count = Extractor::getRealValue($this->popFromOperandStack());
23
- // need reference
24
- $ref = new \ArrayIterator(array_fill(0, $count, null));
25
- $this->pushToOperandStackByReference($ref);
+ // Get an array size
+ $count = Extractor::getRealValue(
+ $this->popFromOperandStack()
+ );
+
26
+ // Make an array with object.
27
+ $array = new \ArrayIterator(
28
+ array_fill(
29
+ 0,
30
+ $count,
31
+ null
32
+ )
33
34
35
+ $this->pushToOperandStackByReference(
36
+ $array
37
38
}
39
0 commit comments