phpday 2027 - Call for Papers

Migrating from PHP 8.2.x to PHP 8.3.x

Table of Contents

This new minor version brings with it a number of new features and a few incompatibilities that should be tested for before switching PHP versions in production environments.

See also the migration guides for PHP versions 7.1.x, 7.2.x, 7.3.x, 7.4.x, 8.0.x, 8.1.x, 8.2.x.

+add a note

User Contributed Notes 3 notes

up
3
Anonymous
9 days ago
<script>
    const btn = document.getElementById("btn-blague");
    const question = document.getElementById("question");
    const reponse = document.getElementById("reponse");

    btn.addEventListener("click", function() {
        fetch("https://official-joke-api.appspot.com/random_joke")
            .then(res => res.json())
            .then(donnees => {
                question.textContent = donnees.setup;
                reponse.textContent = donnees.punchline;
            });
    });
</script>
up
1
Anonymous
9 days ago
<script>
    const btn = document.getElementById("btn-blague");
    const question = document.getElementById("question");
    const reponse = document.getElementById("reponse");

    btn.addEventListener("click", function() {
        fetch("https://official-joke-api.appspot.com/random_joke")
            .then(res => res.json())
            .then(donnees => {
                question.textContent = donnees.setup;
                reponse.textContent = donnees.punchline;
            });
    });
</script>
up
-2
tata at toto dot com
24 days ago
// LES CATS EN MAJUSCULES (EXERCICE 1) // 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<?php
    /**
     * EXERCISE
     * 
     * Given an array of strings $tab, write a PHP script that displays each string in a list (<ul> tag).
     * If the string contains the word "cat", it should be displayed in uppercase.
     */
    
    $tab = ["cat", "dog", "catapult", "catfish", "dogfish", "catamaran", "This is a cat", "This is a dog"];
    echo "<ul>";
    for ($i = 0 ; $i < count($tab) ; $i++){
        if (strpos($tab[$i],"cat") === false) {
            echo "<li>" . $tab[$i] . "</li>";
        }
        else {
            echo "<li>" . strtoupper($tab[$i]) . "</li>";
        }
    }
    echo "</ul>";

?>
    
</body>
</html>

// USE URL PARAMETERS (EXERCICE 2) //
 
if (isset($_GET["animal"]) && isset($_GET["sound"])) {
    echo("<p>The ".$_GET["animal"]." says ".$_GET["sound"]."</p>");
}
elseif (isset($_GET["animal"])) {
    echo("<p>The ".$_GET["animal"]." is silent.</p>");
}
elseif (isset($_GET["sound"])) {
    echo("<p>Which animal says ".$_GET["sound"]."?</p>");
}
else {
    echo("<p>Nothing to say here...</p>");
}
To Top