3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function($cname){ if ($cname == 'IMyInterface') { interface IMyInterface { // Use any class or interface constant as value of FOO. // I'll just use some constant available out of the box, to keep it simple: const FOO = FilesystemIterator::CURRENT_AS_PATHNAME; } } elseif ($cname == 'Foo') { class Foo implements IMyInterface {} } elseif ($cname == 'Bar') { class Bar extends Foo implements IMyInterface {} } }); // Foo is super-class for Bar. // uncomment below line to trigger the error: $F = new Foo(); // this should run without errors at any time, but if Foo is instantiated // prior to this line, then the error is triggered: $B = new Bar();
Output for git.master, git.master_jit, rfc.property-hooks

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
135.37 ms | 405 KiB | 5 Q