Updated sample 5 according to PHP sample 5.