PHP 8.4.24 Released!

Voting

: seven minus four?
(Example: nine)

The Note You're Voting On

Xiong Chiamiov
12 years ago
const can also be used directly in namespaces, a feature never explicitly stated in the documentation.

<?php
# foo.php
namespace Foo;

const BAR = 1;
?>

<?php
# bar.php
require 'foo.php';

var_dump(Foo\BAR); // => int(1)
?>

<< Back to user notes page

To Top