Fix bug in example.php

- Reported in #30780 - thanks to Dan M.