Skip to content

Commit 096e40a

Browse files
committed
Fixed tests for recent constant array changes
1 parent 99d1a1b commit 096e40a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Zend/zend_ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,11 @@ ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
351351
zend_ast *new = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * (ast->children - 1));
352352
int i;
353353
new->kind = ast->kind;
354+
new->children = ast->children;
354355
for (i = 0; i < ast->children; i++) {
355356
(&new->u.child)[i] = zend_ast_copy((&ast->u.child)[i]);
356357
}
358+
return new;
357359
}
358360
return zend_ast_create_dynamic(ast->kind);
359361
}

tests/classes/constants_error_002.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
Error case: class constant as an array
33
--FILE--
44
<?php
5-
class myclass
6-
{
7-
const myConst = array();
8-
}
5+
class myclass
6+
{
7+
const myConst = array();
8+
}
99
?>
10+
===DONE===
1011
--EXPECTF--
11-
12-
Fatal error: Arrays are not allowed in class constants in %s on line 4
12+
===DONE===

0 commit comments

Comments
 (0)