3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* Template Name: Dashboard */ if (!is_user_logged_in()) { // je vérifie si je suis connecté wp_redirect( home_url() . "/connexion" ); // si pas je redirige vers la page login exit; } get_header(); include_once 'includes/randomName.php'; ?> <body> <nav class="navbar navbar-expand-lg position-absolute w-100" style="z-index: 10;"> <div class="container"> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/dashboard'))); ?>" class="navbar-brand"> <img src="<?php echo get_template_directory_uri(); ?>/logo/Logo.svg" alt="Logo" width="70" height="58"> </a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#menu"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="menu"> <ul class="navbar-nav me-auto"> <li class="nav-item"> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/jeux-video-logged-in'))); ?>" class="nav-link active">Jeux vidéo</a> </li> <li class="nav-item"> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/consoles-logged-in'))); ?>" class="nav-link active">Consoles</a> </li> <li class="nav-item"> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/qui-sommes-nous-logged-in'))); ?>" class="nav-link active">Qui sommes-nous</a> </li> </ul> <div class="ms-auto d-flex align-items-center"> <a class="text-white" href="<?php echo esc_url(get_permalink(get_page_by_path('/profil'))); ?>" class="d-flex align-items-center me-3"> <i class="bi bi-person-fill me-3 footer-icon"></i></a> <a class="text-white" href="<?php echo esc_url(get_permalink(get_page_by_path('/chat-box'))); ?>" class="d-flex align-items-center me-4"> <i class="bi bi-chat-fill footer-icon me-3"></i></a> <?php if (is_user_logged_in()):?> <a href="<?php echo wp_logout_url();?>" class="custom-button">Déconnexion</a> <?php endif; ?> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/creer-une-annonce'))); ?>" class="custom-button">Créer une annonce</a> </div> </div> </div> </nav> <div class="position-relative"> <img src="<?php echo get_template_directory_uri(); ?>/images/hero.png" alt="gensquijouent" class="img-fluid w-100" style="border-radius: 0;"> <div class="position-absolute top-50 start-50 translate-middle text-center text-white p-md-4"> <h1 class="display-3 display-md-1"><b>BACK2PIXELS</b></h1> <p class="lead lead-md">Le site où vos jeux et consoles trouvent une nouvelle vie : échangez facilement et connectez-vous avec des passionnés comme vous !</p> <p class="lead lead-md"><b>T’es prêt ? À toi de jouer !</b></p> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/creer-une-annonce'))); ?>" class="custom-button">CRÉER UNE ANNONCE</a> </div> </div> <div class="container mt-5"> <div class="row gy-3"> <div class="col-md-6"> <div class="card" style="max-width: 400px; margin: 0 auto;"> <img src="<?php echo get_template_directory_uri(); ?>/images/JEUX.png" class="card-img-top" alt="explorerjeux"> <div class="card-body"> <h5 class="card-title">DÉCOUVRE LES JEUX VIDÉO</h5> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/jeux-video-logged-in'))); ?>" class="custom-button">EXPLORER</a> </div> </div> </div> <div class="col-md-6"> <div class="card" style="max-width: 400px; margin: 0 auto;"> <img src="<?php echo get_template_directory_uri(); ?>/images/CONSOLES.png" class="card-img-top" alt="explorerconsoles"> <div class="card-body"> <h5 class="card-title">DÉCOUVRE LES CONSOLES</h5> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/consoles-logged-in'))); ?>" class="custom-button">EXPLORER</a> </div> </div> </div> </div> </div> <div class="container"> <div class="row gy-5 mb-5"> <div class="col-6 col-md-3"> <h1><br><b>FIL D'ACTUALITÉ</b></br></h1> <hr style="border-top: 6px solid #7058A8; margin: 5px 0;"> </div> </div> </div> </body> <?php $games = new WP_Query([ 'post_type' => 'games', 'post_status' => 'publish' ]); if ($games->have_posts()) : $i = 1; ?> <div class="container my-5"> <div class="row gy-5"> <?php while ($games->have_posts()) : $games->the_post(); ?> <div class="col-6 col-md-3"> <div class="card" style="max-width: 250px; margin: 0 auto;"> <div class="d-flex align-items-center p-2"> <?php $name = randomName(); ?> <img src="<?php echo 'https://robohash.org/' . $name; ?>" alt="Avatar personnalisé" class="img-thumbnail" style="width: 40px; height: 40px;" /> <span class="ms-2"><?php echo $name; ?></span> </div> <?php $custom_link = get_field('custom_link'); if ($custom_link) { if (strpos($custom_link, 'http') !== 0) { $custom_link = home_url($custom_link); } } else { $custom_link = get_permalink(); } ?> <a href="<?php echo esc_url($custom_link); ?>"> <?php the_post_thumbnail('medium', [ 'class' => 'card-img-top' ]); ?> </a> <div class="card-body"> <h5 class="card-title"><?php the_title(); ?></h5> <p><?php the_content(); ?></p> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/chat-box'))); ?>" class="custom-button">MESSAGE</a> </div> </div> </div> <?php $i++; endwhile; ?> </div> </div> </div> <?php endif; ?> <?php $stations = new WP_Query([ 'post_type' => 'stations', 'post_status' => 'publish' ]); if ($stations->have_posts()) : $i = 1; ?> <div class="container"> <div class="row gy-5 mb-5"> <div class="container my-5"> <div class="row gy-5"> <?php while ($stations->have_posts()) : $stations->the_post(); ?> <div class="col-6 col-md-3"> <div class="card" style="max-width: 250px; margin: 0 auto;"> <div class="d-flex align-items-center p-2"> <?php $name = randomName(); ?> <img src="<?php echo 'https://robohash.org/' . $name; ?>" alt="Avatar personnalisé" class="img-thumbnail" style="width: 40px; height: 40px;" /> <span class="ms-2"><?php echo $name; ?></span> </div> <?php $custom_link = get_field('custom_link'); if ($custom_link) { if (strpos($custom_link, 'http') !== 0) { $custom_link = home_url($custom_link); } } else { $custom_link = get_permalink(); } ?> <a href="<?php echo esc_url($custom_link); ?>"> <?php the_post_thumbnail('medium', [ 'class' => 'card-img-top' ]); ?> </a> <div class="card-body"> <h5 class="card-title"><?php the_title(); ?></h5> <p><?php the_content(); ?></p> <a href="<?php echo esc_url(get_permalink(get_page_by_path('/chat-box'))); ?>" class="custom-button">MESSAGE</a> </div> </div> </div> <?php $i++; endwhile; ?> </div> </div> </div> </div> <?php endif; ?> <?php $user = wp_get_current_user(); ?> <?php get_footer(); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0090.01420.26
8.4.150.0080.00516.98
8.4.140.0090.01217.94
8.4.130.0040.00418.18
8.4.120.0090.00420.57
8.4.110.0130.00720.73
8.4.100.0130.00817.95
8.4.90.0080.00220.67
8.4.80.0090.01018.97
8.4.70.0110.01018.76
8.4.60.0090.01118.73
8.4.50.0150.00818.61
8.4.40.0100.00718.26
8.4.30.0060.01318.60
8.4.20.0300.01017.77
8.4.10.0030.00718.05
8.3.280.0020.00014.05
8.3.270.0100.01016.77
8.3.260.0080.00916.85
8.3.250.0130.00619.05
8.3.240.0080.01016.61
8.3.230.0050.00316.84
8.3.220.0030.00419.04
8.3.210.0120.00816.74
8.3.200.0120.00716.47
8.3.190.0060.00318.71
8.3.180.0100.00917.13
8.3.170.0040.01517.00
8.3.160.0120.00616.75
8.3.150.0220.00916.55
8.3.140.0190.00916.73
8.3.130.0150.00316.48
8.3.120.0160.00216.34
8.3.110.0090.00916.71
8.3.100.0160.00516.73
8.3.90.0170.00316.62
8.3.80.0150.00716.55
8.3.70.0130.00716.68
8.3.60.0190.00216.94
8.3.50.0180.00416.70
8.3.40.0160.00517.35
8.3.30.0190.00017.42
8.3.20.0160.00317.51
8.3.10.0150.00217.38
8.3.00.0050.00517.59
8.2.290.0120.00718.90
8.2.280.0110.01018.44
8.2.270.0090.00016.75
8.2.260.0110.00516.69
8.2.250.0120.00616.86
8.2.240.0120.00616.87
8.2.230.0120.00416.89
8.2.220.0150.00416.40
8.2.210.0170.00016.50
8.2.200.0130.00416.86
8.2.190.0160.00016.57
8.2.180.0140.00416.39
8.2.170.0170.00017.43
8.2.160.0160.00317.45
8.2.150.0160.00617.53
8.2.140.0230.00817.45
8.2.130.0120.00617.50
8.2.120.0260.00017.35
8.2.110.0200.00817.39
8.2.100.0130.01617.30
8.2.90.0220.00017.38
8.2.80.0120.00617.70
8.2.70.0170.00017.38
8.2.60.0120.01217.45
8.2.50.0140.01417.45
8.2.40.0200.00017.40
8.2.30.0190.00217.69
8.2.20.0170.01017.33
8.2.10.0220.00017.11
8.2.00.0200.00717.36
8.1.320.0050.00316.20

preferences:
121.13 ms | 403 KiB | 5 Q