3v4l.org

run code in 300+ PHP versions simultaneously
<? include('con.php'); $q1 = mysqli_query($con, "SELECT * FROM blank_codes"); $total = mysqli_num_rows($q1); $z = 0; while($row=mysqli_fetch_array($q1, MYSQLI_ASSOC)){ $timeout = $row['time_out']; $timein = $row['creation_date']; $x = 0; $a = array(); $b = array(); for($x = 0; $x < $total; $x++){ $timeoutX = strtotime($timeout); $timeinX = strtotime($timein); array_push($a, $timeoutX); array_push($b, $timeinX); } } $zx = array_sum($a); $zy = array_sum($b); $time_diff = $a-$b; $new = date("Y-m-d", $time_diff); echo "$new &nbsp; $time_diff"; ?>
Output for 8.0.13, 8.5.1 - 8.5.3
Warning: include(con.php): Failed to open stream: No such file or directory in /in/lSEUL on line 2 Warning: include(): Failed opening 'con.php' for inclusion (include_path='.:') in /in/lSEUL on line 2 Fatal error: Uncaught Error: Call to undefined function mysqli_query() in /in/lSEUL:4 Stack trace: #0 {main} thrown in /in/lSEUL on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.32, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0
<? include('con.php'); $q1 = mysqli_query($con, "SELECT * FROM blank_codes"); $total = mysqli_num_rows($q1); $z = 0; while($row=mysqli_fetch_array($q1, MYSQLI_ASSOC)){ $timeout = $row['time_out']; $timein = $row['creation_date']; $x = 0; $a = array(); $b = array(); for($x = 0; $x < $total; $x++){ $timeoutX = strtotime($timeout); $timeinX = strtotime($timein); array_push($a, $timeoutX); array_push($b, $timeinX); } } $zx = array_sum($a); $zy = array_sum($b); $time_diff = $a-$b; $new = date("Y-m-d", $time_diff); echo "$new &nbsp; $time_diff"; ?>
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: include(con.php): failed to open stream: No such file or directory in /in/lSEUL on line 2 Warning: include(): Failed opening 'con.php' for inclusion (include_path='.:') in /in/lSEUL on line 2 Fatal error: Uncaught Error: Call to undefined function mysqli_query() in /in/lSEUL:4 Stack trace: #0 {main} thrown in /in/lSEUL on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Warning: include(): open_basedir restriction in effect. File(con.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/lSEUL on line 2 Warning: include(con.php): failed to open stream: Operation not permitted in /in/lSEUL on line 2 Warning: include(): Failed opening 'con.php' for inclusion (include_path='.:') in /in/lSEUL on line 2 Fatal error: Uncaught Error: Call to undefined function mysqli_query() in /in/lSEUL:4 Stack trace: #0 {main} thrown in /in/lSEUL on line 4
Process exited with code 255.
Output for 5.5.17, 5.6.0 - 5.6.38
Warning: include(): open_basedir restriction in effect. File(con.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/lSEUL on line 2 Warning: include(con.php): failed to open stream: Operation not permitted in /in/lSEUL on line 2 Warning: include(): Failed opening 'con.php' for inclusion (include_path='.:') in /in/lSEUL on line 2 Fatal error: Call to undefined function mysqli_query() in /in/lSEUL on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.16, 5.5.18 - 5.5.38
Warning: include(con.php): failed to open stream: No such file or directory in /in/lSEUL on line 2 Warning: include(): Failed opening 'con.php' for inclusion (include_path='.:') in /in/lSEUL on line 2 Fatal error: Call to undefined function mysqli_query() in /in/lSEUL on line 4
Process exited with code 255.

preferences:
118.72 ms | 2653 KiB | 4 Q