Manuel PHP

SplInt::__construct

(No version information available, might be only in CVS)

SplInt::__constructConstructs an integer object type

Description

SplInt::__construct ( void )

This constructs a new object of type float.

Liste de paramètres

input

The input parameter accepts an integer An UnexpectedValueException Exception will be thrown if anything is passed.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 SplInt::__construct() example

  1. <?php
  2. $int = new SplInt(94);  
  3.  
  4. try { 
  5.    $int = 'Try to cast a string value for fun';  
  6. } catch (UnexpectedValueException $uve) { 
  7.    echo $uve->getMessage() . PHP_EOL;  
  8. }  
  9.  
  10. var_dump($int);  
  11. echo $int; // Outputs 94
  12. ?> 

L'exemple ci-dessus va afficher :

Value not an integer object(SplInt)#1 (1) { ["__default"]=> int(94) } 94


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Bretagne - php - Moto - Kit graphique