[php] Generate PHP type declarations
We now automatically generate PHP type declarations for PHP >= 8.0. The generated code still compiles with PHP 7.x but without type declarations.
This commit is contained in:
parent
76d5a9ec27
commit
1f1349741f
12 changed files with 536 additions and 196 deletions
|
|
@ -16,7 +16,8 @@
|
|||
struct Geometry {
|
||||
enum GeomType{
|
||||
POINT,
|
||||
CIRCLE
|
||||
CIRCLE,
|
||||
SHAPELESS
|
||||
};
|
||||
|
||||
virtual ~Geometry() {}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,14 @@ $tr=copy_intp(4);
|
|||
check::equal(4,inctr($tr),"4==incr($tr)");
|
||||
check::equal(5,intp_value($tr),"5==$tr");
|
||||
|
||||
# Check the voidhandle call, first with null
|
||||
# Check the voidhandle call, first with NULL and then with the SWIG\p_void we
|
||||
# get from the first call.
|
||||
$handle=NULL;
|
||||
voidhandle($handle);
|
||||
check::equal(get_class($handle),"SWIG\\_p_void",'$handle is not _p_void');
|
||||
$handledata=handle($handle);
|
||||
check::equal($handledata,"Here it is","\$handledata != \"Here it is\"");
|
||||
for ($i=0; $i != 1; $i++) {
|
||||
voidhandle($handle);
|
||||
check::equal(get_class($handle),"SWIG\\_p_void",'$handle is not _p_void');
|
||||
$handledata=handle($handle);
|
||||
check::equal($handledata,"Here it is","\$handledata != \"Here it is\"");
|
||||
}
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
|
|
@ -17,4 +17,7 @@ $point = Geometry::create(Geometry::POINT);
|
|||
$w = $point->width();
|
||||
check::equal($w, 1.0, "w failed");
|
||||
|
||||
$point = Geometry::create(Geometry::SHAPELESS);
|
||||
check::equal($point, NULL, "NULL failed");
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue