3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Temple\Modules\Content\Controllers; class Controller { /* private $request; public function __construct(Request $request = null) { $this->request = $request; } protected function getRequest() { return $this->request; } */ protected function render($file) { if (strpos($file, ':') !== false) { list($module, $file) = explode(':', $file); if ($module == 'CoreApp') { $path = CORE_APP_PATH; } else { $path = MODULES_PATH . '/' . $module; } } else { $module = preg_replace('#\\\?Temple\\\Modules\\\([^\\\]+)\\\.*#', '\1', get_called_class()); $path = MODULES_PATH . '/' . $module; } $path = str_replace('\\', DIRECTORY_SEPARATOR, $path); $path .= '/Views/'; $exp = explode('.', $file); $engine = array_pop($exp); $type = array_pop($exp); echo $path . $file; echo "\n"; } } class PagesController extends Controller { public function indexAction() { //return new Response('Ciao! :)'); } public function showAction($id) { // $page = Page::find($id); // // echo $page->category->route->url; $this->render('show.html.twig'); $this->render('admin/new.html.twig'); $this->render('CoreApp:path/to/file.html.twig'); $this->render('Module:path/to/file.html.twig'); $this->render('file.js.twig'); $this->render('file.json.twig'); $this->render('file.css.twig'); $this->render('file.xml.twig'); } } $x = new PagesController(); $x->showAction(4);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du8FZ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   75     0  E >   NEW                                              $1      'Temple%5CModules%5CContent%5CControllers%5CPagesController'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   76     3        INIT_METHOD_CALL                                         !0, 'showAction'
          4        SEND_VAL_EX                                              4
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Temple\Modules\Content\Controllers\Controller:
Function render:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 26
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du8FZ
function name:  render
number of ops:  63
compiled vars:  !0 = $file, !1 = $module, !2 = $path, !3 = $exp, !4 = $engine, !5 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cstrpos'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              '%3A'
          4        DO_FCALL                                      0  $6      
          5        TYPE_CHECK                                  1018          $6
          6      > JMPZ                                                     ~7, ->26
   23     7    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cexplode'
          8        SEND_VAL_EX                                              '%3A'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $8      
         11        FETCH_LIST_R                                     $9      $8, 0
         12        ASSIGN                                                   !1, $9
         13        FETCH_LIST_R                                     $11     $8, 1
         14        ASSIGN                                                   !0, $11
         15        FREE                                                     $8
   24    16        IS_EQUAL                                                 !1, 'CoreApp'
         17      > JMPZ                                                     ~13, ->21
   25    18    >   FETCH_CONSTANT                                   ~14     'Temple%5CModules%5CContent%5CControllers%5CCORE_APP_PATH'
         19        ASSIGN                                                   !2, ~14
         20      > JMP                                                      ->25
   27    21    >   FETCH_CONSTANT                                   ~16     'Temple%5CModules%5CContent%5CControllers%5CMODULES_PATH'
         22        CONCAT                                           ~17     ~16, '%2F'
         23        CONCAT                                           ~18     ~17, !1
         24        ASSIGN                                                   !2, ~18
         25    > > JMP                                                      ->38
   30    26    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cpreg_replace'
         27        SEND_VAL_EX                                              '%23%5C%5C%3FTemple%5C%5CModules%5C%5C%28%5B%5E%5C%5C%5D%2B%29%5C%5C.%2A%23'
         28        SEND_VAL_EX                                              '%5C1'
         29        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cget_called_class'
         30        DO_FCALL                                      0  $20     
         31        SEND_VAR_NO_REF_EX                                       $20
         32        DO_FCALL                                      0  $21     
         33        ASSIGN                                                   !1, $21
   32    34        FETCH_CONSTANT                                   ~23     'Temple%5CModules%5CContent%5CControllers%5CMODULES_PATH'
         35        CONCAT                                           ~24     ~23, '%2F'
         36        CONCAT                                           ~25     ~24, !1
         37        ASSIGN                                                   !2, ~25
   34    38    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cstr_replace'
         39        SEND_VAL_EX                                              '%5C'
         40        FETCH_CONSTANT                                   ~27     'Temple%5CModules%5CContent%5CControllers%5CDIRECTORY_SEPARATOR'
         41        SEND_VAL_EX                                              ~27
         42        SEND_VAR_EX                                              !2
         43        DO_FCALL                                      0  $28     
         44        ASSIGN                                                   !2, $28
   35    45        ASSIGN_OP                                     8          !2, '%2FViews%2F'
   37    46        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cexplode'
         47        SEND_VAL_EX                                              '.'
         48        SEND_VAR_EX                                              !0
         49        DO_FCALL                                      0  $31     
         50        ASSIGN                                                   !3, $31
   38    51        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Carray_pop'
         52        SEND_VAR_EX                                              !3
         53        DO_FCALL                                      0  $33     
         54        ASSIGN                                                   !4, $33
   39    55        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Carray_pop'
         56        SEND_VAR_EX                                              !3
         57        DO_FCALL                                      0  $35     
         58        ASSIGN                                                   !5, $35
   41    59        CONCAT                                           ~37     !2, !0
         60        ECHO                                                     ~37
   42    61        ECHO                                                     '%0A'
   43    62      > RETURN                                                   null

End of function render

End of class Temple\Modules\Content\Controllers\Controller.

Class Temple\Modules\Content\Controllers\PagesController:
Function indexaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du8FZ
function name:  indexAction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E > > RETURN                                                   null

End of function indexaction

Function showaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du8FZ
function name:  showAction
number of ops:  26
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   54     0  E >   RECV                                             !0      
   60     1        INIT_METHOD_CALL                                         'render'
          2        SEND_VAL_EX                                              'show.html.twig'
          3        DO_FCALL                                      0          
   61     4        INIT_METHOD_CALL                                         'render'
          5        SEND_VAL_EX                                              'admin%2Fnew.html.twig'
          6        DO_FCALL                                      0          
   63     7        INIT_METHOD_CALL                                         'render'
          8        SEND_VAL_EX                                              'CoreApp%3Apath%2Fto%2Ffile.html.twig'
          9        DO_FCALL                                      0          
   65    10        INIT_METHOD_CALL                                         'render'
         11        SEND_VAL_EX                                              'Module%3Apath%2Fto%2Ffile.html.twig'
         12        DO_FCALL                                      0          
   67    13        INIT_METHOD_CALL                                         'render'
         14        SEND_VAL_EX                                              'file.js.twig'
         15        DO_FCALL                                      0          
   68    16        INIT_METHOD_CALL                                         'render'
         17        SEND_VAL_EX                                              'file.json.twig'
         18        DO_FCALL                                      0          
   69    19        INIT_METHOD_CALL                                         'render'
         20        SEND_VAL_EX                                              'file.css.twig'
         21        DO_FCALL                                      0          
   70    22        INIT_METHOD_CALL                                         'render'
         23        SEND_VAL_EX                                              'file.xml.twig'
         24        DO_FCALL                                      0          
   71    25      > RETURN                                                   null

End of function showaction

Function render:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 26
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du8FZ
function name:  render
number of ops:  63
compiled vars:  !0 = $file, !1 = $module, !2 = $path, !3 = $exp, !4 = $engine, !5 = $type
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cstrpos'
          2        SEND_VAR_EX                                              !0
          3        SEND_VAL_EX                                              '%3A'
          4        DO_FCALL                                      0  $6      
          5        TYPE_CHECK                                  1018          $6
          6      > JMPZ                                                     ~7, ->26
   23     7    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cexplode'
          8        SEND_VAL_EX                                              '%3A'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $8      
         11        FETCH_LIST_R                                     $9      $8, 0
         12        ASSIGN                                                   !1, $9
         13        FETCH_LIST_R                                     $11     $8, 1
         14        ASSIGN                                                   !0, $11
         15        FREE                                                     $8
   24    16        IS_EQUAL                                                 !1, 'CoreApp'
         17      > JMPZ                                                     ~13, ->21
   25    18    >   FETCH_CONSTANT                                   ~14     'Temple%5CModules%5CContent%5CControllers%5CCORE_APP_PATH'
         19        ASSIGN                                                   !2, ~14
         20      > JMP                                                      ->25
   27    21    >   FETCH_CONSTANT                                   ~16     'Temple%5CModules%5CContent%5CControllers%5CMODULES_PATH'
         22        CONCAT                                           ~17     ~16, '%2F'
         23        CONCAT                                           ~18     ~17, !1
         24        ASSIGN                                                   !2, ~18
         25    > > JMP                                                      ->38
   30    26    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cpreg_replace'
         27        SEND_VAL_EX                                              '%23%5C%5C%3FTemple%5C%5CModules%5C%5C%28%5B%5E%5C%5C%5D%2B%29%5C%5C.%2A%23'
         28        SEND_VAL_EX                                              '%5C1'
         29        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cget_called_class'
         30        DO_FCALL                                      0  $20     
         31        SEND_VAR_NO_REF_EX                                       $20
         32        DO_FCALL                                      0  $21     
         33        ASSIGN                                                   !1, $21
   32    34        FETCH_CONSTANT                                   ~23     'Temple%5CModules%5CContent%5CControllers%5CMODULES_PATH'
         35        CONCAT                                           ~24     ~23, '%2F'
         36        CONCAT                                           ~25     ~24, !1
         37        ASSIGN                                                   !2, ~25
   34    38    >   INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cstr_replace'
         39        SEND_VAL_EX                                              '%5C'
         40        FETCH_CONSTANT                                   ~27     'Temple%5CModules%5CContent%5CControllers%5CDIRECTORY_SEPARATOR'
         41        SEND_VAL_EX                                              ~27
         42        SEND_VAR_EX                                              !2
         43        DO_FCALL                                      0  $28     
         44        ASSIGN                                                   !2, $28
   35    45        ASSIGN_OP                                     8          !2, '%2FViews%2F'
   37    46        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Cexplode'
         47        SEND_VAL_EX                                              '.'
         48        SEND_VAR_EX                                              !0
         49        DO_FCALL                                      0  $31     
         50        ASSIGN                                                   !3, $31
   38    51        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Carray_pop'
         52        SEND_VAR_EX                                              !3
         53        DO_FCALL                                      0  $33     
         54        ASSIGN                                                   !4, $33
   39    55        INIT_NS_FCALL_BY_NAME                                    'Temple%5CModules%5CContent%5CControllers%5Carray_pop'
         56        SEND_VAR_EX                                              !3
         57        DO_FCALL                                      0  $35     
         58        ASSIGN                                                   !5, $35
   41    59        CONCAT                                           ~37     !2, !0
         60        ECHO                                                     ~37
   42    61        ECHO                                                     '%0A'
   43    62      > RETURN                                                   null

End of function render

End of class Temple\Modules\Content\Controllers\PagesController.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.27 ms | 1412 KiB | 25 Q