function __autoload( $className ){ global $classPath; if( $className !== 'Safe' ){ $safeClassName = Safe( $className ); if( file_exists( $classPath.$safeClassName->toDir().'.php' ) ){ include $classPath.$safeClassName->toDir().'.php'; }else{ throw new Exception( "Could not find class '{$safeClassName->toException()}' will most likely die horribly." ); } }else{ include $classPath.'Safe.php'; } };
<?php include './config.php'; $phpPersonConstructorFN = new PHPFunctionNode( Safe( "__constructor" ), Safe( "public" ) ); $phpPersonConstructorFN->addInput( null, Safe( "firstName" ), null ); $phpPersonConstructorFN->addInput( null, Safe( "lastName" ), null ); $phpPersonConstructorFN->setBody( Safe( "\$this->_firstName = \$firstName; \$this->_lastName = \$lastName;" ) ); $phpPersonHelloFN = new PHPFunctionNode( Safe( "hello" ), Safe( "public" ) ); $phpPersonHelloFN->addOutput( ); $phpPersonHelloFN->setBody( Safe( "echo \"Hello {\$this->_firstName} {\$this->_lastName}\";" ) ); echo $phpPersonConstructorFN->debugNode(); echo $phpPersonHelloFN->debugNode(); ?>