Skip to content

Commit

Permalink
Fix error code
Browse files Browse the repository at this point in the history
  • Loading branch information
zither committed Jan 15, 2015
1 parent ff58c71 commit dc53dd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book/chapt05/05-04-class-inherit-abstract.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ PHP内核将类的继承实现放在了"编译阶段",因此使用VLD生成中
$context->run();

$cat = new Cat();
$context = new Context();
$context = new Context($cat);
$context->run();

上面是策略模式示例性的简单实现。对于不同的动物,其跑的方式不一样,
Expand Down

0 comments on commit dc53dd5

Please sign in to comment.