3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generatePattern($n) { // Assure-toi que l'entrée est un nombre entier if (!is_int($n) || $n <= 0) { return "Veuillez entrer un nombre entier positif."; } // Boucle pour générer chaque ligne for ($i = $n; $i >= 1; $i--) { // Génère une ligne avec le chiffre $n répété $i fois echo str_repeat($n, $i) . PHP_EOL; } } generatePattern(2); echo "\n"; generatePattern(3); echo "\n"; generatePattern(4); echo "\n"; generatePattern(5);
Output for git.master_jit, git.master
22 2 333 33 3 4444 444 44 4 55555 5555 555 55 5

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.75 ms | 405 KiB | 5 Q