Skip to content

Instantly share code, notes, and snippets.

@nikic nikic/p1.php Secret
Created May 15, 2019

Embed
What would you like to do?
<?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
You can’t perform that action at this time.