3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class ModelRecord { const TABLE = ''; const PRIMARY = ''; public function load($id) { if(self::TABLE === static::TABLE OR self::PRIMARY === static::PRIMARY) throw new UnexpectedValueException("TABLE or PRIMARY const not implemented"); var_dump(static::TABLE, static::PRIMARY); } } class User extends ModelRecord { const TABLE = 'users'; const PRIMARY = 'id'; } class Contact extends ModelRecord { } (new User)->load(1); (new Contact)->load(2);
Output for git.master, git.master_jit, rfc.property-hooks
string(5) "users" string(2) "id" Fatal error: Uncaught UnexpectedValueException: TABLE or PRIMARY const not implemented in /in/AlUal:10 Stack trace: #0 /in/AlUal(26): ModelRecord->load(2) #1 {main} thrown in /in/AlUal on line 10
Process exited with code 255.

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:
118.12 ms | 1552 KiB | 4 Q