3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Request { const METHOD_GET = 'GET'; const METHOD_POST = 'POST'; const METHOD_HEAD = 'HEAD'; const METHOD_PUT = 'PUT'; } $routes = array( '/product-list' => [ Request::METHOD_GET => [ 'alias' => 'catalog_product_list', 'controller' => 'Handel\Catalog\Controller\Product\ProductListController::class', 'method' => 'indexAction', 'requirements' => [], 'options' => [] ] ], '/product/{slug}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_product', 'controller' => 'Handel\Catalog\Controller\Product\ProductController::class', 'method' => 'indexAction' ] ], '/compare' => [ Request::METHOD_GET => [ 'alias' => 'catalog_compare_index', 'controller' => 'Handel\Catalog\Controller\Product\CompareController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_compare_add', 'controller' => 'Handel\Catalog\Controller\Product\CompareController::class', 'method' => 'postAction' ] ], '/category-list' => [ Request::METHOD_GET => [ 'alias' => 'catalog_category_list', 'controller' => 'Handel\Catalog\Controller\Product\CategoryListController::class', 'method' => 'indexAction' ] ], '/category/{slug}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_category', 'controller' => 'Handel\Catalog\Controller\Product\CategoryController::class', 'method' => 'indexAction' ] ], '/manufacturer-list' => [ Request::METHOD_GET => [ 'alias' => 'catalog_manufacturer_list', 'controller' => 'Handel\Catalog\Controller\Product\ManufacturerListController::class', 'method' => 'indexAction' ] ], '/manufacturer/{slug}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_manufacturer', 'controller' => 'Handel\Catalog\Controller\Product\ManufacturerController::class', 'method' => 'indexAction' ] ], '/information-list' => [ Request::METHOD_GET => [ 'alias' => 'catalog_information_list', 'controller' => 'Handel\Catalog\Controller\Information\InformationListController::class', 'method' => 'indexAction' ] ], '/information/{slug}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_information', 'controller' => 'Handel\Catalog\Controller\Information\InformationController::class', 'method' => 'indexAction' ] ], '/terms-and-conditions' => [ Request::METHOD_GET => [ 'alias' => 'catalog_terms', 'controller' => 'Handel\Catalog\Controller\Information\TermsController::class', 'method' => 'indexAction' ] ], '/about-us' => [ Request::METHOD_GET => [ 'alias' => 'catalog_about', 'controller' => 'Handel\Catalog\Controller\Information\AboutController::class', 'method' => 'indexAction' ] ], '/search' => [ Request::METHOD_GET => [ 'alias' => 'catalog_search', 'controller' => 'Handel\Catalog\Controller\Product\SearchController::class', 'method' => 'indexAction' ] ], '/account' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_account', 'controller' => 'Handel\Catalog\Controller\Account\AccountController::class', 'method' => 'indexAction' ] ], '/account/address' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_address_book', 'controller' => 'Handel\Catalog\Controller\Account\AddressBookController::class', 'method' => 'indexAction' ] ], '/account/address/{id}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_address', 'controller' => 'Handel\Catalog\Controller\Account\AddressController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_address', 'controller' => 'Handel\Catalog\Controller\Account\AddressController::class', 'method' => 'postAction' ], ], '/account/forgotten' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_forgotten', 'controller' => 'Handel\Catalog\Controller\Account\ForgottenController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_forgotten_post', 'controller' => 'Handel\Catalog\Controller\Account\ForgottenController::class', 'method' => 'postAction' ], ], '/account/login' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_login', 'controller' => 'Handel\Catalog\Controller\Account\LoginController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_login_post', 'controller' => 'Handel\Catalog\Controller\Account\LoginController::class', 'method' => 'postAction' ] ], '/account/logout' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_logout', 'controller' => 'Handel\Catalog\Controller\Account\LogoutController::class', 'method' => 'indexAction' ] ], '/account/newsletter' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_newsletter', 'controller' => 'Handel\Catalog\Controller\Account\NewsletterController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_newsletter_post', 'controller' => 'Handel\Catalog\Controller\Account\NewsletterController::class', 'method' => 'postAction' ], ], '/account/register' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_register', 'controller' => 'Handel\Catalog\Controller\Account\RegisterController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_register_post', 'controller' => 'Handel\Catalog\Controller\Account\RegisterController::class', 'method' => 'postAction' ] ], '/account/order-history/{id}' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_order', 'controller' => 'Handel\Catalog\Controller\Account\OrderController::class', 'method' => 'indexAction' ] ], '/account/order-history' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_order_history', 'controller' => 'Handel\Catalog\Controller\Account\OrderHistoryController::class', 'method' => 'indexAction' ] ], '/account/wishlist' => [ Request::METHOD_GET => [ 'alias' => 'catalog_account_wishlist', 'controller' => 'Handel\Catalog\Controller\Account\WishListController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_account_wishlist_post', 'controller' => 'Handel\Catalog\Controller\Account\WishListController::class', 'method' => 'postAction' ] ], '/affiliate/login' => [ Request::METHOD_GET => [ 'alias' => 'catalog_affiliate_login', 'controller' => 'Handel\Catalog\Controller\Affiliate\LoginController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_affiliate_login_post', 'controller' => 'Handel\Catalog\Controller\Affiliate\LoginController::class', 'method' => 'postAction' ], ], '/affiliate/register' => [ Request::METHOD_GET => [ 'alias' => 'catalog_affiliate_register', 'controller' => 'Handel\Catalog\Controller\Affiliate\RegisterController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_affiliate_register_post', 'controller' => 'Handel\Catalog\Controller\Affiliate\RegisterController::class', 'method' => 'postAction' ] ], '/cart' => [ Request::METHOD_GET => [ 'alias' => 'catalog_cart', 'controller' => 'Handel\Catalog\Controller\Common\CartController::class', 'method' => 'indexAction' ], Request::METHOD_POST => [ 'alias' => 'catalog_cart_post', 'controller' => 'Handel\Catalog\Controller\Common\CartController::class', 'method' => 'postAction' ] ], '/checkout' => [ Request::METHOD_GET => [ 'alias' => 'catalog_checkout', 'controller' => 'Handel\Catalog\Controller\Checkout\CheckoutController::class', 'method' => 'indexAction' ] ], '/checkout/payment-address' => [ Request::METHOD_GET => [ 'alias' => 'catalog_checkout_payment_address', 'controller' => 'Handel\Catalog\Controller\Checkout\BillingAddressController::class', 'method' => 'indexAction' ] ], '/checkout/shipping-address' => [ Request::METHOD_GET => [ 'alias' => 'catalog_checkout_delivery_address', 'controller' => 'Handel\Catalog\Controller\Checkout\ShippingAddressController::class', 'method' => 'indexAction' ] ], '/checkout/shipping-method' => [ Request::METHOD_GET => [ 'alias' => 'catalog_checkout_delivery_method', 'controller' => 'Handel\Catalog\Controller\Checkout\ShippingMethodController::class', 'method' => 'indexAction' ] ], '/' => [ Request::METHOD_GET => [ 'alias' => 'catalog_index', 'controller' => 'Handel\Catalog\Controller\Common\HomeController::class', 'method' => 'indexAction' ] ], ); $output = []; foreach ($routes as $path => $data) { foreach ($data as $http_method => $values) { $alias = $values['alias']; $controller = $values['controller']; $method = $values['method']; $output[$alias] = [ 'path' => $path, 'controller' => [$controller, $method], 'requirements' => [], 'defaults' => [], 'methods' => [$http_method] ]; } } var_dump($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 25
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 25
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/7T32a
function name:  (null)
number of ops:  32
compiled vars:  !0 = $routes, !1 = $output, !2 = $data, !3 = $path, !4 = $values, !5 = $http_method, !6 = $alias, !7 = $controller, !8 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, <array>
  282     1        ASSIGN                                                   !1, <array>
  284     2      > FE_RESET_R                                       $11     !0, ->27
          3    > > FE_FETCH_R                                       ~12     $11, !2, ->27
          4    >   ASSIGN                                                   !3, ~12
  285     5      > FE_RESET_R                                       $14     !2, ->25
          6    > > FE_FETCH_R                                       ~15     $14, !4, ->25
          7    >   ASSIGN                                                   !5, ~15
  286     8        FETCH_DIM_R                                      ~17     !4, 'alias'
          9        ASSIGN                                                   !6, ~17
  287    10        FETCH_DIM_R                                      ~19     !4, 'controller'
         11        ASSIGN                                                   !7, ~19
  288    12        FETCH_DIM_R                                      ~21     !4, 'method'
         13        ASSIGN                                                   !8, ~21
  291    14        INIT_ARRAY                                       ~24     !3, 'path'
  292    15        INIT_ARRAY                                       ~25     !7
         16        ADD_ARRAY_ELEMENT                                ~25     !8
         17        ADD_ARRAY_ELEMENT                                ~24     ~25, 'controller'
  291    18        ADD_ARRAY_ELEMENT                                ~24     <array>, 'requirements'
         19        ADD_ARRAY_ELEMENT                                ~24     <array>, 'defaults'
  295    20        INIT_ARRAY                                       ~26     !5
         21        ADD_ARRAY_ELEMENT                                ~24     ~26, 'methods'
  290    22        ASSIGN_DIM                                               !1, !6
  295    23        OP_DATA                                                  ~24
  285    24      > JMP                                                      ->6
         25    >   FE_FREE                                                  $14
  284    26      > JMP                                                      ->3
         27    >   FE_FREE                                                  $11
  300    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class Request: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.96 ms | 1396 KiB | 15 Q