private function open_php( &$src ){
		if( ! $this->inphp ){
			$this->inphp = true;
			
			// this may result in back to back tags, which we can avoid with a bit of string manipulation.
			$makenice = $this->opt(COMPILER_OPTION_NICE_TAGS);
			
			if( $makenice && substr( $src, -2 ) === '?>' ){
				// trim trailing close tag, so no need to open one
				$src = substr_replace( $src, '', -2 );
			}
			else {
				$ws = $this->opt(COMPILER_OPTION_WHITESPACE) ? "\n" : ' ';
				$src .= '<?php'.$ws;
			}
		}
		return $src;	
	}
private function open_php( &$src ){
		if( ! $this->inphp ){
			$this->inphp = true;
			
			// this may result in back to back tags, which we can avoid with a bit of string manipulation.
			$makenice = $this->opt(COMPILER_OPTION_NICE_TAGS);
			
			if( $makenice && substr( $src, -2 ) === '?>' ){
				// trim trailing close tag, so no need to open one
				$src = substr_replace( $src, '', -2 );
			}
			else {
				$ws = $this->opt(COMPILER_OPTION_WHITESPACE) ? "\n" : ' ';
				$src .= '<?php'.$ws;
			}
		}
		return $src;	
	}
private function open_php ( & $ src ) { if ( ! $ this -> inphp ) { $ this -> inphp = true ; // this may result in back to back tags, which we can avoid with a bit of string manipulation. $ makenice = $ this -> opt ( COMPILER_OPTION_NICE_TAGS ) ; if ( $ makenice && substr ( $ src , - 2 ) === '?>' ) { // trim trailing close tag, so no need to open one $ src = substr_replace ( $ src , '' , - 2 ) ; } else { $ ws = $ this -> opt ( COMPILER_OPTION_WHITESPACE ) ? "\n" : ' ' ; $ src .= '<?php' . $ ws ; } } return $ src ; }
Open php tag if required.
@usage <code>$src = $this->open_php( $src );</code>
@param string current php source to modify
@return void
Open php tag if required .