Php Replace Item In Array Python Methods And Classes In Java