3v4l.org

run code in 200+ PHP versions simultaneously
<?php 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()); //

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: Could not check compatibility between BulldogFeeder::feed(Bulldog $dog) and DogFeeder::feed(Dog $dog), because class Dog is not available in /in/sULkI on line 14
Process exited with code 255.
Output for branch php-master+opcache
Fatal error: Could not check compatibility between BulldogFeeder::feed(Bulldog $dog) and DogFeeder::feed(Dog $dog), because class Dog is not available in /in/sULkI on line 14
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