Array subscription test.
All checks were successful
The build was successful.

This commit is contained in:
Rafal Kupiec 2019-04-19 07:54:53 +02:00
parent a0405f2267
commit 16c6b8d970
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 70 additions and 0 deletions

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;
}
}

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)
}