PHPParser_Node_Scalar_String::__construct PHP Method

__construct() public method

Constructs a string scalar node.
public __construct ( string $value = '', $string_type, integer $line, null | string $docComment = null )
$value string Value of the string
$line integer Line
$docComment null | string Nearest doc comment
    public function __construct($value = '', $string_type, $line = -1, $docComment = null)
    {
        if ($string_type === "'") {
            $value = preg_replace_callback("#[^\\\\][']+?#Uis", 'phpparser_node_scalar_string_replace_single', $value);
        } elseif ($string_type === '"') {
            $value = preg_replace_callback('#[^\\\\]"+?#Uis', 'phpparser_node_scalar_string_replace_double', $value);
        } else {
            throw new Exception("Unsupported string type.");
        }
        parent::__construct(array('value' => $value, 'string_type' => $string_type), $line, $docComment);
    }
PHPParser_Node_Scalar_String