Пример #1
0
 public function call()
 {
     takes_int(1.0);
     // should succeed, weak mode
 }
<?php

function takes_int(int $x)
{
    global $errored;
    if ($errored) {
        echo "Failure!", PHP_EOL;
        $errored = FALSE;
    } else {
        echo "Success!", PHP_EOL;
    }
}
declare (strict_types=1);
var_dump(takes_int(32));