3v4l.org

run code in 300+ PHP versions simultaneously
<?php $o=new C1();/*this is OK, because C1 does not implement anything, it can be declared anywhere.*/ $o=new C2();/*this is NOT ok, because C2 implements something, it must be declared before being used.*/ class C1 /*implements nothing*/ { } class C2 implements Countable{ function count(){} }

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
49.66 ms | 2693 KiB | 4 Q