Confirming whether session is started or not

I was intrigued and decided to repeatedly try session_start();

Test script:

<?php 
declare(strict_types=1);
error_reporting(-1);
ini_set('display_errors', '1');

session_start();
session_start(); // LINE :7 

echo '<br>phpversion() ==> ' .phpversion();

Output:

Notice: session_start():
A session had already been started - ignoring in /var/www/aDomain.com/public_html/index.php on line 7

phpversion() ==> 7.2.23-1+ubuntu19.04.1+deb.sury.org+1

Edit:
Added phpversion()

@dennisjn, kudos for checking the PHP Manual - session_start()

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.