xref: /PHP-8.2/Zend/tests/mod_001.phpt (revision 5bc1e224)
1--TEST--
2modulus by zero
3--FILE--
4<?php
5
6$a = array(1,2,3);
7$b = array();
8
9try {
10    $c = $a % $b;
11    var_dump($c);
12} catch (TypeError $e) {
13    echo "Exception: " . $e->getMessage() . "\n";
14}
15
16echo "Done\n";
17?>
18--EXPECTF--
19Exception: Unsupported operand types: array % array
20Done
21