1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which PHP 8.3 feature allows declaring a constant on a…

Added 14 Sep 2025

Which PHP 8.3 feature allows declaring a constant on a trait?

  1. trait constants Correct answer
  2. class constants
  3. interface constants
  4. enum constants

Correct answer

A. trait constants

13 views

MCQSEXAM

Explanation

PHP 8.3 adds trait const so traits can now define constants that become part of the composing class.

Reference

https://www.php.net/releases/8_3_0.php

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs