Skip to content

Instantly share code, notes, and snippets.

@mglinski
Last active January 10, 2017 16:30
Show Gist options
  • Select an option

  • Save mglinski/b5ddab6e162d0f96c6d28a78af4f715b to your computer and use it in GitHub Desktop.

Select an option

Save mglinski/b5ddab6e162d0f96c6d28a78af4f715b to your computer and use it in GitHub Desktop.

Revisions

  1. mglinski revised this gist Jan 10, 2017. 2 changed files with 4 additions and 4 deletions.
    4 changes: 2 additions & 2 deletions run.php
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    <?php

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n";
    echo "Return Types With Strict Types DISABLED in include file\n";
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n";
    echo "Return Types With Strict Types ENABLED in include file\n";
    include 'includeStrict.php';
    }

    4 changes: 2 additions & 2 deletions runStrict.php
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,10 @@
    declare(strict_types=1);

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n";
    echo "Return Types With Strict Types DISABLED in include file\n";
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n";
    echo "Return Types With Strict Types ENABLED in include file\n";
    include 'includeStrict.php';
    }

  2. mglinski revised this gist Jan 10, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion includeStrict.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <?php
    declare(strict_types=1)
    declare(strict_types=1);

    function returnsInt() : int {
    return 2;
    2 changes: 1 addition & 1 deletion runStrict.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <?php
    declare(strict_types=1)
    declare(strict_types=1);

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n";
  3. mglinski revised this gist Jan 10, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion includeStrict.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <?php
    define(strict_types=1);
    declare(strict_types=1)

    function returnsInt() : int {
    return 2;
    2 changes: 1 addition & 1 deletion runStrict.php
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    <?php
    define(strict_types=1);
    declare(strict_types=1)

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n";
  4. mglinski revised this gist Jan 10, 2017. 2 changed files with 4 additions and 4 deletions.
    4 changes: 2 additions & 2 deletions run.php
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,10 @@
    <?php

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n"
    echo "Return Types With Strict Types DISABLED\n";
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n"
    echo "Return Types With Strict Types ENABLED\n";
    include 'includeStrict.php';
    }

    4 changes: 2 additions & 2 deletions runStrict.php
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,10 @@
    define(strict_types=1);

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n"
    echo "Return Types With Strict Types DISABLED\n";
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n"
    echo "Return Types With Strict Types ENABLED\n";
    include 'includeStrict.php';
    }

  5. mglinski created this gist Jan 10, 2017.
    17 changes: 17 additions & 0 deletions include.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?php

    function returnsInt() : int {
    return 2;
    }

    function returnsFloat() : float {
    return 1;
    }

    function returnsBool() : bool {
    return 1;
    }

    function returnsString() : string {
    return 1;
    }
    18 changes: 18 additions & 0 deletions includeStrict.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <?php
    define(strict_types=1);

    function returnsInt() : int {
    return 2;
    }

    function returnsFloat() : float {
    return 1;
    }

    function returnsBool() : bool {
    return 1;
    }

    function returnsString() : string {
    return 1;
    }
    16 changes: 16 additions & 0 deletions run.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    <?php

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n"
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n"
    include 'includeStrict.php';
    }

    var_dump([
    'returnsInt' => returnsInt(),
    'returnsFloat' => returnsFloat(),
    'returnsBool' => returnsBool(),
    'returnsString' => returnsString(),
    ]);
    17 changes: 17 additions & 0 deletions runStrict.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?php
    define(strict_types=1);

    if (rand(0,1)) {
    echo "Return Types With Strict Types DISABLED\n"
    include 'include.php';
    } else {
    echo "Return Types With Strict Types ENABLED\n"
    include 'includeStrict.php';
    }

    var_dump([
    'returnsInt' => returnsInt(),
    'returnsFloat' => returnsFloat(),
    'returnsBool' => returnsBool(),
    'returnsString' => returnsString(),
    ]);