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

Case Insensitive Cast

<?php

$string = '123';
$integer = (INT) $string;

PHP’s cast operators are case-insensitive, meaning variations like (int), (INT), and (iNt) all work the same way. However, the common convention is to use all lowercase, such as (int). Using other case styles is technically valid but extremely rare and generally discouraged for consistency and readability in code. Stick to lowercase for better code standards.

See Also

PHP Features

Last updated: 11 October 2026