Camel Case

Camel case, also written camelCase is a way of writing names without spaces, where:

  • The first word starts with a lowercase letter

  • Each following word starts with an uppercase letter

The capital letters create humps like a camel’s back: this is the origin of the name.

Camel case is often used for method and variable names. Class names, on the other hand, use Pascal case.

<?php

    function calculatePrice(int $price): int {
        return $price * SALE_TAX_RATE;
    }

?>

Documentation

See also stringcase website.

Related : Pascal Case, Snake Case, Constant Case