3v4l.org

run code in 300+ PHP versions simultaneously
<?php // \Drupal\Core\Entity\EntityInterface interface EntityInterface { // ... } // \Drupal\Core\Entity\OwnerInterface interface OwnerInterface extends EntityInterface { // Just a marker interface (for now?). } // \Drupal\user\UserInterface interface UserInterface extends OwnerInterface { // ... } // \Drupal\user\User class User implements UserInterface { } // \Drupal\Core\Entity\OwnedEntityInterface interface OwnedEntityInterface { // For callers this work fine when you pass an object whose class implements // UserInterface. Implementors may need to adapt but this is fine according to // our current policies (https://www.drupal.org/core/d8-bc-policy): // "Interfaces follow a similar pattern as above with respect to @api, // @internal, or neither. However, in case of neither tag, the interface is // treated as an API for callers but not for implementers." public function setOwner(OwnerInterface $owner); // ... } // Example class. class OwnedEntity implements OwnedEntityInterface { public function setOwner(OwnerInterface $owner) {} } /** * @deprecated */ // \Drupal\user\EntityOwnerInterface interface EntityOwnerInterface extends OwnedEntityInterface { // This now empty, all methods are in "OwnedEntityInterface". } $user = new User(); $entity = new OwnedEntity(); $entity->setOwner($user);
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:
18.32 ms | 401 KiB | 8 Q