Skip to content

Commit 076f220

Browse files
author
cpriest
committed
Added two tests that ensure isset/unset cannot accept parameters.
1 parent def448b commit 076f220

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
ZE2 Tests that an issetter defined with parameters throws an error
3+
--FILE--
4+
<?php
5+
6+
class TimePeriod {
7+
public $Hours {
8+
isset($x) { return 5; }
9+
}
10+
}
11+
12+
?>
13+
--EXPECTF--
14+
Parse error: syntax error, unexpected '$x' (T_VARIABLE), expecting ')' in %s on line %d
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
ZE2 Tests that an unsetter defined with parameters throws an error
3+
--FILE--
4+
<?php
5+
6+
class TimePeriod {
7+
public $Hours {
8+
unset($x) { return 5; }
9+
}
10+
}
11+
12+
?>
13+
--EXPECTF--
14+
Parse error: syntax error, unexpected '$x' (T_VARIABLE), expecting ')' in %s on line %d

0 commit comments

Comments
 (0)