xref: /PHP-8.2/ext/date/tests/strtotime-mysql.phpt (revision 95f4ee38)
1--TEST--
2strtotime() and mysql timestamps (32 bit)
3--SKIPIF--
4<?php if (PHP_INT_SIZE == 8) die("skip 32-bit only"); ?>
5--FILE--
6<?php
7date_default_timezone_set('UTC');
8
9/* Format: YYYYMMDDHHMMSS */
10$d[] = '19970523091528';
11$d[] = '20001231185859';
12$d[] = '20800410101010'; // overflow..
13
14foreach($d as $date) {
15    $time = strtotime($date);
16
17    if (is_integer($time)) {
18        var_dump(date('r', $time));
19    } else {
20        var_dump($time);
21    }
22}
23?>
24--EXPECTF--
25string(31) "Fri, 23 May 1997 09:15:28 +0000"
26string(31) "Sun, 31 Dec 2000 18:58:59 +0000"
27
28Warning: strtotime(): Epoch doesn't fit in a PHP integer in %s on line %d
29bool(false)
30