3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface SomeSerializableTrait {} interface SomeResizableInterface {} class SomeContainer implements SerializableInterface, IterableInterface { use SomeSerializableTrait; } class SomeOtherContainer extends SomeContainer implements SomeResizableInterface {} $someContainer = new SomeContainer; $someOtherContainer = new SomeAnotherContainer; var_dump($someContainer instanceof SerializableInterface); var_dump($someOtherContainer instanceof SerializableInterface); var_dump($someOtherContainer instanceof SomeSerializableTrait);
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: SomeContainer cannot use SomeSerializableTrait - it is not a trait in /in/sqsI1 on line 5
Process exited with code 255.
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught Error: Interface "SerializableInterface" not found in /in/sqsI1:5 Stack trace: #0 {main} thrown in /in/sqsI1 on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Interface 'SerializableInterface' not found in /in/sqsI1:5 Stack trace: #0 {main} thrown in /in/sqsI1 on line 5
Process exited with code 255.
Output for 7.0.6 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Fatal error: SomeContainer cannot use SomeSerializableTrait - it is not a trait in /in/sqsI1 on line 6
Process exited with code 255.
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.5
Fatal error: Interface 'SerializableInterface' not found in /in/sqsI1 on line 5
Process exited with code 255.

preferences:
212.59 ms | 402 KiB | 257 Q