mirror of
https://github.com/php/php-src.git
synced 2026-04-26 01:18:19 +02:00
Add 'import const' example.
This commit is contained in:
@@ -301,6 +301,17 @@ Changes in the Zend Engine 2.0
|
||||
func2();
|
||||
?>
|
||||
|
||||
Example:
|
||||
|
||||
<?php
|
||||
class MyOuterClass {
|
||||
const Hello = "Hello, World\n";
|
||||
}
|
||||
|
||||
import const Hello from MyOuterClass;
|
||||
print Hello;
|
||||
?>
|
||||
|
||||
Old code that does not take advantage of namespaces will run
|
||||
without modifications.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user