PHP를 처음 사용했습니다. Java 코드를 PHP로 변환하려고하지만 거의 성공하지 못했습니다. 특히 변수 형 long을 선언하고 클래스의 객체를 배열로 선언 할 수 있습니다.Java에서 PHP 형식으로 코드를 변환하십시오.
public class Company extends User implements Serializable {
private static final long serialVersionUID = 8598447488057067508L;
public String id;
public String companyName;
public String companyCode;
public String avatar;
public Price price;
public List<History> history;
public List<Wall> wallpost;
public boolean isFollowing;
public String toString() {
return "Company [id=" + id
+ ", companyName=" + companyName
+ ", companyCode=" + companyCode
+ ", avatar=" + avatar + "]";
}
}
는 PHP
<?php
include "History.php";
include "Price.php";
include "Wall.php";
class Company extends User implements Serializable {
private static final long $serialVersionUID = 8598447488057067508L;// get error here
public $id;
public $companyName;
public $companyCode;
public $avatar;
public Price $price;//object of Price Class how to declare this?
public List<History> $history;//object of History Class how to declare this as a List?
public List<Wall> $wallpost;//object of Wall Class how to declare this as a list?
public boolean $isFollowing; //how to assign boolean to this variable?
}
에서 나는 PHP이 주조하는 방법이있을 shud 생각합니다.
도움 주셔서 감사합니다.
당신이 PHP와 자바를 변환 할 수있는 도구를 시도 했습니까? –
@ 에반 : 무료 및 오픈 소스 도구를 제안 해 주시겠습니까? –
@ MD.MohiuddinAhmed, 나는 시도했지만 운이 없었습니다. 결과를 확인하십시오 : http://myhashcode.blogspot.sg/2015/02/convert-java-to-php.html –