3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Dog {} class Bulldog {} interface DogFeeder { function feed(Dog $dog); } function feedChihuahua(DogFeeder $feeder) { $feeder->feed(new Chihuahua()); // this code is OK } class BulldogFeeder implements DogFeeder { function feed(Bulldog $dog) { } } // feedChihuahua(new BulldogFeeder());
based on UQleg

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
Fatal error: Declaration of BulldogFeeder::feed(Bulldog $dog) must be compatible with DogFeeder::feed(Dog $dog) in /in/f1SKJ on line 15
Process exited with code 255.
Output for branch php-master+opcache
Fatal error: Declaration of BulldogFeeder::feed(Bulldog $dog) must be compatible with DogFeeder::feed(Dog $dog) in /in/f1SKJ on line 15
Process exited with code 255.

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