Skip to content

Commit 806a2a0

Browse files
Better example
1 parent 8e76e65 commit 806a2a0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Zend/tests/friends/example_002.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ var_dump($alice);
3636
$bob = $builder->newWithName("Bob");
3737
var_dump($bob);
3838

39-
// Creation outside of the builder fails
39+
// Manipulation outside of the builder fails
4040
try {
41-
$unknown = new User();
41+
$bob->userId = 2;
4242
} catch (Error $e) {
4343
echo $e;
4444
}
@@ -57,6 +57,6 @@ object(User)#%d (2) {
5757
["username"]=>
5858
string(3) "Bob"
5959
}
60-
Error: Call to private User::__construct() from global scope in %s:%d
60+
Error: Cannot modify private(set) property User::$userId from global scope in %s:%d
6161
Stack trace:
6262
#0 {main}

0 commit comments

Comments
 (0)