summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/bug75556.phpt
blob: 1b2511c580ac166148eba24eec31d7dcef58eb39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Bug #75556 (Invalid opcode 138/1/1)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
 function createFromFormat($format, $date, ?\DateTimeZone $tz = null): ?\DateTimeInterface
 {
	 if ($tz !== null
			 || ($tz instanceof \DateTimeZone && !in_array($tz->getName(), ['UTC', 'Z'], true))
		) {
		 $msg = 'Date objects must have UTC as their timezone';
		 throw new \UnexpectedValueException($msg);
	 }

	return null;
}

var_dump(createFromFormat('m/d/Y', '12/07/2017', null));
?>
--EXPECT--
NULL