Games PHP Scope Rooms

Scope Rooms

Function scope, global, static, closures with use, fn and $this.

0 / 7 levels · 0 / 21 ★Start playing ›
  1. Scope Rooms

    Every function call is a fresh, empty room with its own name tags. Nothing from outside comes in unless you bring it through the door: a parameter, global, or a closure's use. static is a drawer in the room that keeps its contents between visits.

Your rulebook

Finish a level to add its rule. Fill the book and you can explain all of this in an interview.

  1. 1Finish A fresh room to unlock this rule.
  2. 2Finish Through the door: parameter or global to unlock this rule.
  3. 3Finish The drawer that remembers to unlock this rule.
  4. 4Finish use packs a copy to unlock this rule.
  5. 5Finish use (&$x) carries a link to unlock this rule.
  6. 6Finish fn packs everything it uses to unlock this rule.
  7. 7Finish $this comes along to unlock this rule.