Voting

: six minus four?
(Example: nine)

The Note You're Voting On

Raheel Khan
10 years ago
class constant are by default public in nature but they cannot be assigned visibility factor and in turn gives syntax error

<?php

class constants {

const
MAX_VALUE = 10;
public const
MIN_VALUE =1;

}

// This will work
echo constants::MAX_VALUE;

// This will return syntax error
echo constants::MIN_VALUE;
?>

<< Back to user notes page

To Top