In PHP
You install PHP and Composer, you run source files directly, and a typed function will coerce "5" unless that file says strict_types. Composer's lockfile is how an app builds the same way twice. Nothing in this chapter asked you to stop doing that.
In Rust
This chapter taught five things:
- What Rust checks — a type mismatch (
E0308) or a live conflicting borrow (E0502) stops the compile; PHP often coerces until that line runs. - Install with rustup — one installer for
rustcandcargo, confirm withrustup show. - Cargo —
cargo new,cargo run,cargo fmt,cargo clippy, debug vs release (including overflow behaviour). - Dependencies and pinning —
cargo add, commitCargo.lockfor apps, pin the team toolchain inrust-toolchain.toml(neverrustup default nightly). - A small CLI — read lines, stop at EOF, test pure arithmetic with
cargo test.
[dev-dependencies] is Composer's require-dev. CI should pass --locked. The site does not run those tests for you. Run them locally, or use the Playground Test action on the calculator lesson.
Key takeaways
- rustup installs the toolchain; pin a specific stable version for the team.
- Cargo is the everyday tool: new, run, fmt, clippy, add, test.
- PHP coerces by default. Rust does not compile the mismatch.
Cargo.lockand--lockedkeep builds repeatable.- The calculator stops at EOF, and
cargo testcovers the arithmetic.
Take the chapter quiz from the button on this page. It opens a separate page. Thirteen questions, and you need 80% to pass. After you submit, each question shows a one-line explanation.
What's next: Variables