We now automatically generate PHP type declarations for PHP >= 8.0. The generated code still compiles with PHP 7.x but without type declarations.
23 lines
499 B
PHP
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();
|