Converted to PHP.