Skip to content

Instantly share code, notes, and snippets.

@gmorel
Created April 21, 2015 14:38
Show Gist options
  • Select an option

  • Save gmorel/a00ce37ea8f0262ae69c to your computer and use it in GitHub Desktop.

Select an option

Save gmorel/a00ce37ea8f0262ae69c to your computer and use it in GitHub Desktop.

Revisions

  1. gmorel created this gist Apr 21, 2015.
    25 changes: 25 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    <?php

    class A
    {

    public function methodA()
    {
    echo 'A';
    }
    }

    class B extends A
    {
    public function methodA($test = false)
    {
    echo 'B';
    }
    }


    $b = new B();
    $b->methodA();

    // Display 'B' without error