Browse Source

Array subscription test.

release/v0.1
Rafal Kupiec 2 years ago
parent
commit
16c6b8d970
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 70 additions and 0 deletions
  1. +20
    -0
      tests/array_subscription.aer
  2. +50
    -0
      tests/array_subscription.exp

+ 20
- 0
tests/array_subscription.aer View File

@ -0,0 +1,20 @@
class Program {
int main() {
int[] $arr1;
int[] $arr2 = {0, 0};
float[] $arr3 = {1, 4.5};
$arr1 = {1, 2, 3, 4, 5};
$arr1[] = 6;
$arr1[] = {7};
$arr1[] = {'test' => 8};
$arr1[] = $arr2;
$arr3[] = {4, 5, 6.5};
$arr3[] = 7.2;
$arr3[] = 9;
var_dump($arr1);
var_dump($arr3);
return 0;
}
}

+ 50
- 0
tests/array_subscription.exp View File

@ -0,0 +1,50 @@
array(int, 9) {
[0] =>
int(1)
[1] =>
int(2)
[2] =>
int(3)
[3] =>
int(4)
[4] =>
int(5)
[5] =>
int(6)
[6] =>
array(int, 1) {
[0] =>
int(7)
}
[7] =>
array(int, 1) {
[test] =>
int(8)
}
[8] =>
array(int, 2) {
[0] =>
int(0)
[1] =>
int(0)
}
}
array(float, 5) {
[0] =>
float(1)
[1] =>
float(4.5)
[2] =>
array(float, 3) {
[0] =>
float(4)
[1] =>
float(5)
[2] =>
float(6.5)
}
[3] =>
float(7.2)
[4] =>
float(9)
}

Loading…
Cancel
Save