PHP 8.4.0 RC3 available for testing

IntlChar::isJavaIDStart

(PHP 7, PHP 8)

IntlChar::isJavaIDStartVérifie si un point de code est permis comme premier caractère dans un identifiant Java

Description

public static IntlChar::isJavaIDStart(int|string $codepoint): ?bool

Détermine si le caractère spécifié est permis comme premier caractère dans un identifiant Java.

En plus de IntlChar::isIDStart(), true pour les caractères de catégorie générale "Sc" (symboles de devise) et "Pc" (ponctuation de connexion).

Liste de paramètres

codepoint

La valeur codepoint de type entier (i.e. 0x2603 pour U+2603 SNOWMAN), ou le caractère encodé en UTF-8 de type chaîne de caractères (i.e. "\u{2603}")

Valeurs de retour

Renvoie true si codepoint peut commencer un identifiant Java, false sinon. Renvoie null en cas d'échec.

Exemples

Exemple #1 Test de différents codepoint

<?php
var_dump
(IntlChar::isJavaIDStart("A"));
var_dump(IntlChar::isJavaIDStart("$"));
var_dump(IntlChar::isJavaIDStart("\n"));
var_dump(IntlChar::isJavaIDStart("\u{2603}"));
?>

L'exemple ci-dessus va afficher :

bool(true)
bool(true)
bool(false)
bool(false)

Voir aussi

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top