The example code misses the mandatory require: `require 'vendor/autoload.php';` The code does not run as written in the example.