xref: /PHP-7.4/tests/run-test/test008a.phpt (revision d7a3edd4)
1--TEST--
2Error message handling (with ZendOpcache)
3--SKIPIF--
4<?php
5if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded");
6?>
7--INI--
8track_errors=1
9--FILE--
10<?php
11// If this test fails ask the developers of run-test.php
12//
13// We check the general ini settings which affect error handling
14// and than verify if a message is given by a division by zero.
15// EXPECTF is used here since the error format may change but ut
16// should always contain 'Division by zero'.
17var_dump(ini_get('display_errors'));
18var_dump(ini_get('error_reporting'));
19var_dump(ini_get('log_errors'));
20var_dump(ini_get('track_errors'));
21ini_set('display_errors', 0);
22var_dump(ini_get('display_errors'));
23var_dump($php_errormsg);
24$zero = 0;
25$error = 1 / $zero;
26var_dump($php_errormsg);
27?>
28--EXPECTF--
29Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0
30string(1) "1"
31string(5) "32767"
32string(1) "0"
33string(1) "1"
34string(1) "0"
35NULL
36string(%d) "%sivision by zer%s"
37