-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy path_fastore.php
More file actions
34 lines (29 loc) · 872 Bytes
/
_fastore.php
File metadata and controls
34 lines (29 loc) · 872 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
<?php
declare(strict_types=1);
namespace PHPJava\Kernel\Mnemonics;
use PHPJava\Kernel\Filters\Normalizer;
use PHPJava\Kernel\Types\Float_;
use PHPJava\Kernel\Types\Type;
final class _fastore extends AbstractOperationCode implements OperationCodeInterface
{
public function getOperands(): ?Operands
{
parent::getOperands();
if ($this->operands !== null) {
return $this->operands;
}
return $this->operands = new Operands();
}
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] = Float_::get($value);
}
}