downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Flujos> <SplString
Last updated: Fri, 20 May 2011

view this page in

SplString::__construct

(PECL spl_types >= 0.1.0)

SplString::__constructConstruye un objeto del tipo string

Descripción

SplString::__construct() ( string $input )

Construye un nuevo objeto del tipo string.

Parámetros

input

El parámetro input solo acepta strings Lanzará una excepción UnexpectedValueException si se pasa cualquier otro tipo.

Valores devueltos

No devuelve ningún valor.

Ejemplos

Example #1 Ejemplo de SplString::__construct()

<?php
$string 
= new SplString("Testing");

try {
    
$string = array();
} catch (
UnexpectedValueException $uve) {
    echo 
$uve->getMessage() . PHP_EOL;
}

var_dump($string);
echo 
$string// Devuelve "Testing"
?>

El resultado del ejemplo sería:

Value not a string
object(SplString)#1 (1) {
  ["__default"]=>
  string(7) "Testing"
}
Testing



add a note add a note User Contributed Notes SplString::__construct
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites