-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy path_dastore.php
More file actions
37 lines (32 loc) · 927 Bytes
/
_dastore.php
File metadata and controls
37 lines (32 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Mnemonics;
use PHPJava\Kernel\Filters\Normalizer;
use PHPJava\Kernel\Types\Double_;
use PHPJava\Kernel\Types\Type;
final class _dastore extends AbstractOperationCode implements OperationCodeInterface
{
public function getOperands(): ?Operands
{
parent::getOperands();
if ($this->operands !== null) {
return $this->operands;
}
return $this->operands = new Operands();
}
/**
* store a double into an array.
*/
public function execute(): void
{
parent::execute();
$value = $this->popFromOperandStack();
$index = Normalizer::getPrimitiveValue($this->popFromOperandStack());
/**
* @var Type $arrayref
*/
$arrayref = $this->popFromOperandStack();
// The value is a ref.
$arrayref[$index] = Double_::get($value);
}
}