Skip to content

Instantly share code, notes, and snippets.

View MarioBlazek's full-sized avatar
🎯
Focusing

Mario Blazek MarioBlazek

🎯
Focusing
View GitHub Profile
Error #[2] occurred in [php shell code] at line [3]: [Use of undefined constant what - assumed 'what' (this will throw an Error in a future version of PHP)]
Problem 1
- netgen/layouts-ezplatform 0.12.0 requires netgen/content-browser-ezplatform ~0.12.0 -> satisfiable by netgen/content-browser-ezplatform[0.12.0].
- Installation request for netgen/layouts-ezplatform ~0.12.0 -> satisfiable by netgen/layouts-ezplatform[0.12.0].
- Conclusion: remove symfony/symfony v2.8.51
- Conclusion: don't install symfony/symfony v2.8.51
- Conclusion: don't install symfony/symfony v2.8.50
- Conclusion: don't install symfony/symfony v2.8.49
- Conclusion: don't install symfony/symfony v2.8.48
- Conclusion: don't install symfony/symfony v2.8.47
- Conclusion: don't install symfony/symfony v2.8.46
try {
print "this is our try block n";
throw new Exception();
} catch (Exception $e) {
print "something went wrong, caught yah!";
} finally {
print "this part is always executed n";
}
<?php
class MyCustomException extends Exception { }
function throwMyCustomException() {
throw new MyCustomException('There is something wrong.');
}
try {
throwMyCustomException();
<?php
class MyCustomException extends Exception { }
class MyAnotherCustomException extends Exception { }
try {
throw new MyAnotherCustomException;
} catch (MyCustomException | MyAnotherCustomException $e) {
echo "Caught : " . get_class($e);
}
<?php
class MyCustomException extends Exception { }
function throwMyCustomException() {
throw new MyCustomException('There is something wrong.');
}
try {
throwMyCustomException();
<?php
class MyCustomException extends Exception { }
function exception_handler($exception) {
echo "Uncaught exception: " , $exception->getMessage(), "\n";
}
set_exception_handler('exception_handler');
<?php
namespace AppBundle\Controller;
use Netgen\Bundle\EzPlatformSiteApiBundle\Controller\Controller;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\ContentView;
use Netgen\TagsBundle\API\Repository\Values\Content\Query\Criterion\TagId;
use Netgen\TagsBundle\API\Repository\Values\Tags\Tag;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
ng_recipe:
template: "@ezdesign/content/full/ng_recipe.html.twig"
controller: "app.controller.full:viewRecipe"
match:
Identifier\ContentType: ng_recipe
<?php
namespace AppBundle\Controller;
use AppBundle\Queries\LatestRelatedRecipes;
use Netgen\Bundle\EzPlatformSiteApiBundle\Controller\Controller;
use Netgen\Bundle\EzPlatformSiteApiBundle\View\ContentView;
class FullViewController extends Controller
{