/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/gmp/tests/overloading_with_array.phpt
84 строки
2 KB
Gina Peter Banyard
ext/gmp: Fix segfault when null is encountered on an overloaded operator
02 ноя 2024, 20:36
Не верифицирован
02 ноя 2024, 20:36
5253647
Код
Авторство
О чём код?
--TEST-- GMP operator overloading does not support [] --EXTENSIONS-- gmp --FILE-- <?php $num = gmp_init(42); try { var_dump($num + []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num - []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num * []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num / []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num % []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num ** []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num | []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num & []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num ^ []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num << []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($num >> []); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Unsupported operand types: GMP ** array TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Number must be of type GMP|string|int, array given TypeError: Unsupported operand types: GMP << array TypeError: Unsupported operand types: GMP >> array