Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

array_product() New Checks

array_product() used to cast the arguments to integers before executing the multiplications. Nowadays, the strange types raise a warning, as illustrated here with the array.

PHP code

<?php

print array_product([1, true, []]);

?>

Before

1

After

PHP Warning:  array_product(): Multiplication is not supported on type array

Warning: array_product(): Multiplication is not supported on type array
1

PHP version change

This behavior changed in 8.3.

Error Messages

Extension

© 2023-2026, Damien Seguy - Exakat