Skip to content

Instantly share code, notes, and snippets.

@jonnybarnes
Last active September 20, 2018 08:46
Show Gist options
  • Select an option

  • Save jonnybarnes/25c3a14b19dbfd69f72b1b6a4fa0d09a to your computer and use it in GitHub Desktop.

Select an option

Save jonnybarnes/25c3a14b19dbfd69f72b1b6a4fa0d09a to your computer and use it in GitHub Desktop.

Revisions

  1. jonnybarnes revised this gist Sep 20, 2018. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions 73-heredoc.php
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,17 @@
    <?php

    // some class
    // some method
    // an if statement
    class Foo
    {
    public static function bar(bool $input)
    {
    if ($input === true) {
    $variable = <<<TOKEN
    Hello
    World!
    TOKEN;
    echo $variable;
    }
    }
    }

    var_dump($variable);
    Foo::bar(true);
  2. jonnybarnes created this gist Sep 11, 2018.
    11 changes: 11 additions & 0 deletions 73-heredoc.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php

    // some class
    // some method
    // an if statement
    $variable = <<<TOKEN
    Hello
    World!
    TOKEN;

    var_dump($variable);