Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Writing PHP extensions in Rust

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Writing PHP extensions in Rust

Avatar for Christian Rades

Christian Rades

November 18, 2022
Tweet

More Decks by Christian Rades

Other Decks in Technology

Transcript

  1. Why ? Reduce the reliance on opcache Maybe improve the

    speed of rendering Have fun and learn about interpreters
  2. Clone() • References need to ful fi l lifetimes •

    So just use “owned” types • Comes in many fl avours • &str -> String • &Foo -> Foo
  3. Zval::shallow_clone() • A little different for PHP values • It

    copies the Zval without duplicating its content • &Zval -> Zval
  4. Thank you • The repo: https://github.com/Christian-Rades/Tape • The rust crate:

    https://davidcole1340.github.io/ext-php-rs/introduction.html • Learning rust: https://doc.rust-lang.org/book/ • Learning Lifetimes: https://rust-unof fi cial.github.io/too-many-lists/