GitHub

NOT IN MENU DEBUG

Ver: 4.0.3 - Build: 77a32b0

 

Examples of using DECLARE(STRICT_TYPES=1);

Points to note:
  1. this "parent" file includes a file with either:
    • strict not set - (fn-strict-0.php)
      function parameter type declarations NOT SET
    • strict set - (fn-strict-1.php)
      function parameter type declarations SET
  2. selecting Test calls the relevant file and the function test(...)
  3. Results are shown in the table
 
Tests:
Test(...) Parent included Result Type
test(2, 3) not declared not declared
test(2, 3) not declared Strict=1
test(2, 3) Strict=1 not declared
test(2, 3) Strict=1 Strict=1
 
test("2","3") not declared not declared
test("2","3") Strict=1 not declared 5 JUGGLED
 
test("2","3") not declared Strict=1
test("2","3") Strict=1 Strict=1
 
Included file: fn-strict-0.php   

<?php DECLARE(STRICT_TYPES=1); ?>
<?php  

function test($a$b)
{
  return 
$a $b;
}