$(PHP_PSI_SRCDIR)/src/context.c: $(PHP_PSI_SRCDIR)/config.m4
touch $@
+$(PHP_PSI_BUILDDIR)/parser.h: $(PHP_PSI_BUILDDIR)/parser_proc.h
+ touch $@
$(PHP_PSI_SRCDIR)/src/%.c: $(PHP_PSI_BUILDDIR)/parser.h
touch $@
$(PHP_PSI_SRCDIR)/src/parser_proc.y: $(PHP_PSI_BUILDDIR)/parser.h
+// extern int stat(char *path, struct stat *buf);
function psi\stat(string $path, array &$buf = NULL) : int {
let path = strval($path);
let buf = calloc(1, struct stat);
if (set->count) {
int is_to_array = (set->func->type == PSI_T_TO_ARRAY);
int is_pointer_to_struct = (ref_type->type == PSI_T_STRUCT && ref->var->pointer_level);
- if (is_to_array && !is_pointer_to_struct) {
+
+ if (!is_to_array && !is_pointer_to_struct) {
data->error(E_WARNING, "Inner `set` statement casts only work with "
"to_array() casts on structs or pointers: %s(%s...", set->func->name, set->vars->vars[0]->name);
return 0;
--EXPECTF--
===TEST===
int(0)
-array(13) {
+array(16) {
["st_dev"]=>
int(%d)
["st_ino"]=>
["st_rdev"]=>
int(%d)
["st_size"]=>
- int(76)
+ int(75)
["st_atim"]=>
array(2) {
["tv_sec"]=>
["tv_nsec"]=>
int(%d)
}
+ ["st_atime"]=>
+ int(%d)
["st_mtim"]=>
array(2) {
["tv_sec"]=>
["tv_nsec"]=>
int(%d)
}
+ ["st_mtime"]=>
+ int(%d)
["st_ctim"]=>
array(2) {
["tv_sec"]=>
["tv_nsec"]=>
int(%d)
}
+ ["st_ctime"]=>
+ int(%d)
["st_blksize"]=>
int(%d)
["st_blocks"]=>