Last active
December 23, 2022 19:25
-
-
Save phpguru/2f6f40ac5e0ff6dd4816fc9bacf539af to your computer and use it in GitHub Desktop.
PHP Old-school formatting in 10-year-old legacy project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($a = 1) | |
{ | |
$code = 'here'; | |
function('call','there'); | |
alignment('true'); | |
} | |
else if ($b = 2) | |
{ | |
$code = 'there'; | |
$obj->some_method('call','different'); | |
alignment('true'); | |
} | |
else | |
{ | |
$longLineExample = "Lorem ipsum " | |
." dolor sit amet ". string_function('here') | |
." consequitor spicing"; | |
$code = 'here'; | |
function('call','there'); | |
alignment('true'); | |
} | |
$name = 'example_'; | |
for ($x = 1; $x <= 10; $x++) | |
{ | |
$name .= $x; | |
if (strlen($name > 20) | |
{ | |
$name = modify($name); | |
$pass = $security->secret($name); | |
} | |
else | |
{ | |
$name = strtoupper($name); | |
$x = substr($name, 3, 12); | |
} | |
do_the_thing(); | |
finish_this_loop(); | |
$x .= $x . $name | |
} | |
other_code_follows(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Best described as:
if elseif, else, do, while, for statement formatting: