Outils pour utilisateurs

Outils du site


informatique:php

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
informatique:php [24/01/2025 20:44] – [Syntaxe] Les closures et les classes anonymes cyrilleinformatique:php [26/04/2026 17:21] (Version actuelle) – [Syntaxe] cyrille
Ligne 37: Ligne 37:
 ==== Dans les plus connus ==== ==== Dans les plus connus ====
  
-  * [[/informatique/php/laravel|Laravel]]+  * [[informatique:php:laravel_1|Laravel]]
   * [[/informatique/php/symfony|Symfony]]   * [[/informatique/php/symfony|Symfony]]
   * [[http://framework.zend.com|Zend Framework]] : [[/informatique/php/Zend Framework]], [[wpfr>Zend Framework]], [[http://zend-framework.developpez.com/|ZF sur Developpez.com]]   * [[http://framework.zend.com|Zend Framework]] : [[/informatique/php/Zend Framework]], [[wpfr>Zend Framework]], [[http://zend-framework.developpez.com/|ZF sur Developpez.com]]
   * Prado   * Prado
-  * [[/informatique/php/laravel|Laravel]] The PHP Framework For Web Artisans.+  * [[informatique:php:laravel_1|Laravel]] The PHP Framework For Web Artisans.
   * [[http://mouf-php.com|Mouf]]   * [[http://mouf-php.com|Mouf]]
   * [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]]   * [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]]
Ligne 91: Ligne 91:
 Les generators "[[https://www.php.net/manual/en/language.generators.syntax.php|generator function]]" permettent d'**économiser de la mémoire** lors d'une itération. Au lieu d'accumuler dans un ''tableau'' le résultat d'une fonction, avec ''yield'' les valeurs sont retrournées au fil de l'itération. Les generators "[[https://www.php.net/manual/en/language.generators.syntax.php|generator function]]" permettent d'**économiser de la mémoire** lors d'une itération. Au lieu d'accumuler dans un ''tableau'' le résultat d'une fonction, avec ''yield'' les valeurs sont retrournées au fil de l'itération.
   * [[https://scotch.io/tutorials/understanding-php-generators|Understanding PHP Generators]]   * [[https://scotch.io/tutorials/understanding-php-generators|Understanding PHP Generators]]
 +  * [[https://doeken.org/blog/coroutines-in-php|Exploring Coroutines in PHP]]
 ===== Syntaxe ===== ===== Syntaxe =====
  
Ligne 98: Ligne 98:
   * [[https://www.pierre-giraud.com/php-mysql-apprendre-coder-cours/oriente-objet-closure-classe-anonyme/|Les closures et les classes anonymes en PHP objet]] par Pierre Giraud   * [[https://www.pierre-giraud.com/php-mysql-apprendre-coder-cours/oriente-objet-closure-classe-anonyme/|Les closures et les classes anonymes en PHP objet]] par Pierre Giraud
  
 +==== Les Enums (avec valeurs) ====
 +
 +<code php>
 +enum DocumentFragmentType: string
 +{
 +  case Sujet = 'sujet';
 +  case Situation = 'situation';
 +  public function priority()
 +  {
 +    /* pas besoin 😉
 +    return match ($this) {
 +      DocumentFragmentType::Sujet => DocumentFragmentTypePriority::Sujet,
 +      DocumentFragmentType::Situation => DocumentFragmentTypePriority::Situation,
 +    };
 +    */
 +    return DocumentFragmentTypePriority::from($this->value);
 +  }
 +};
 +enum DocumentFragmentTypePriority: int
 +{
 +  case Sujet = 1;
 +  case Situation = 3;
 +};
  
 +</code>
  
 ===== Outillage ===== ===== Outillage =====
Ligne 220: Ligne 244:
  
 [[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime. [[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime.
 +
 +==== Console ====
 +
 +  * https://github.com/yannoff/console
 +    * A lightweight, simple alternative to symfony/console, designed for easy PHP applications development.
 +    * Aucune dépendence
  
 ==== Cron ==== ==== Cron ====
informatique/php.1737747845.txt.gz · Dernière modification : de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki