Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/p1.php Secret

Created May 15, 2019 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikic/39960cf61b18803fa522e6287cdb17cc to your computer and use it in GitHub Desktop.
Save nikic/39960cf61b18803fa522e6287cdb17cc to your computer and use it in GitHub Desktop.
<?php
opcache_compile_file('p2.php');
<?php
class A {
function foo(): ?int { return null; }
}
class B extends A {
const X = UNRESOLVED;
}
class C extends B {
const X = 42;
function foo(): ?int { return null; }
}
<?php
class B extends A {
function foo(): int { return 24; }
}
$c = new C;
var_dump($c->foo());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment