whoami

Hi, I'm Marcello.I help developers write software that tells a story.

I'm a software author, conference speaker, and educator. I created PhpSpec, Phunkie, and papi-ai; I write and teach about testing, functional programming, and building AI applications in PHP. Off the clock, I write about sociology, religion, and the flavour of human experience.

Marcello Duarte speaking on a conference stage lit in magenta and red
on stage, where I'm happiest

open-source

Tools I've authored

$ phpspec

A SpecBDD toolset for PHP. Describe the behaviour you want, and let the tool drive your design. Once you start spec'ing, you never go back.

PHP

$ phunkie

Functional structures for PHP: Option, ImmList, Validation, monads and friends. Category theory you can actually ship.

PHP

$ papi-ai

Build AI agents and LLM-powered applications in PHP: tools, memory, and orchestration without leaving the language you know.

PHP

blog

Latest writing

15 October 2026 · 14 min read

Write your own coding agent in PHP with Papi

A coding agent is a loop, a handful of tools, a memory, a token budget and a few preferences. Here is one for your terminal, in PHP, with Papi doing the heavy lifting.

  • ai
  • php
  • papi-ai
  • agents

14 October 2026 · 11 min read

Avoiding OOM in Symfony with Phunkie Streams

Two Symfony services, a 96 MB file of car returns, and a 128 MB memory limit. Streaming the body with Phunkie keeps the consumer at 2 MB, once nginx and PHP stop buffering it behind your back.

  • php
  • symfony
  • phunkie
  • streams
  • nginx

2 June 2026 · 17 min read

Writing coding tools in the age of AI

Why the machines that write our code need the discipline we built for humans, and how PhpSpec 9.0 intends to give it to them.

  • testing
  • bdd
  • php
  • phpspec

books

Two books, two worlds

Cover of Evolution of rāsa

Evolution of rāsa

From fear to flavour

Rāsa, the Sanskrit word for flavour, essence, taste, became one of the richest ideas in the history of religious thought. This book traces the evolution of the human/divine relationship in South Asian religious literature: from the fear of the early hymns to the devotional sweetness of bhakti, where tasting God became a discipline of its own.

About this book →
Cover of Building AI Applications with PHP

Building AI Applications with PHP

LLMs, agents, and intelligent features for PHP developers

The AI wave did not skip PHP. It just needed a guide. This book takes you from your first API call to designing full agentic applications: prompting, embeddings, retrieval, tool use, and evaluation, all in the language that powers most of the web.

About this book →