swig/Examples/test-suite/php/li_factory_runme.php
Olly Betts 1f1349741f
[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.
2022-01-20 10:07:44 +13:00

23 lines
499 B
PHP

<?php
require "tests.php";
// No new functions
check::functions(array());
// New classes
check::classes(array('Geometry','Point','Circle'));
// No new vars
check::globals(array());
$circle = Geometry::create(Geometry::CIRCLE);
$r = $circle->radius();
check::equal($r, 1.5, "r failed");
$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();