Login   Register  
PHP Classes
elePHPant
Icontem

File: example.nsim.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Alterisio  >  NamespaceSim  >  example.nsim.php  >  Download  
File: example.nsim.php
Role: Example script
Content type: text/plain
Description: nsim example file
Class: NamespaceSim
Emulate class namespaces under PHP 5
Author: By
Last change: Version 0.5.0
Date: 7 years ago
Size: 598 bytes
 

Contents

Class file image Download
<?php
/**
 * @ignore
 * @package ignore
 */

import TestNamespace;

echo 
TestClass::$test;

echo 
1/0;

$testFunction 'testStatic';
TestClass::
$testFunction('Hi World!');

trigger_error('Ouch');

TestClass::testStatic('Hi World!');

$testClass 'TestClass';
$test = new $testClass('Hi World!');
var_dump($test instanceof TestClass);

$test = new TestClass('Hi World!');
function 
testTypeHinting(TestInterface $testTestInterface $dummy$dummy2 TestClass::TEST_CONSTANT) {
    
$test->test();
}
testTypeHinting($test$test);

echo 
TestClass::TEST_CONSTANT;
?>