PHP code example of imanghafoori / laravel-microscope
1. Go to this page and download the library: Download imanghafoori/laravel-microscope library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imanghafoori / laravel-microscope example snippets
$this-> dd('hello'); // is technically a method call
User:: dd('I am static'); // is technically a static method call
new dd('I am a class'); // here "dd" is the name of a class.
foreach ($products as $product) {
if ($someCond) {
// A lot of code 1
// A lot of code 1
// A lot of code 1
// A lot of code 1
// A lot of code 1
if ($someOtherCond) {
// A lot more code 2
// A lot more code 2
// A lot more code 2
// A lot more code 2
// A lot more code 2
//
} // <--- closes second if
} // <--- closes first if
}
foreach ($products as $product) {
if (! $someCond) {
continue;
}
// A lot of code 1
// A lot of code 1
// A lot of code 1
// A lot of code 1
// A lot of code 1
if (! $someOtherCond) {
continue;
}
// A lot more code 2
// A lot more code 2
// A lot more code 2
// A lot more code 2
// A lot more code 2
}
if ($cond1) {
if ($cond2) {
....
}
}
// we get merged into:
if ($cond1 && $cond2) {
...
}
if ($var1 > 1):
if ($var2 > 2):
echo 'Hey Man';
endif;
endif;
// Or if you avoid putting curly braces...
if ($var1 > 1)
if ($var2 > 2)
echo 'Hey Man';