DEV Community

Discussion on: My beloved PHP cheat sheet

Collapse
 
jonrandy profile image
Jon Randy 🎖️
<?php

//Naming convention
$first_name = 'Mike'. // all lower case with underscore separators
function updateProduct() // camelCase
class ProductItem // StudlyCaps
const ACCESS_KEY = '123abc'; // all upper case with underscore separators

//output
echo 'Hello World';

//variable declaration
$name = 'Mike'; //string
$isActive = true; //boolean
$number = 25; //integer
$amount = 99.95; //float
...
Enter fullscreen mode Exit fullscreen mode

You seem to introduce a naming convention of camel case for var names, then immediately contradict it with $isActive?

Collapse
 
ericchapman profile image
Eric The Coder

Good point :-)