3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller_Promise extends Controller_Template { public function init() { //Error: turns false after second page refresh if (\Auth::check()) { return Model_User::find_by_email(Auth::get_email()); } } } class Controller_Home extends Controller_Promise { public function action_index() { $this->template->user = parent::init(); } public function action_404() { return Response::forge(Presenter::forge('home/404'), 404); } } class Controller_Auth extends Controller_Promise { public function action_login() { if (Input::is_ajax()) { //Error: validates without any sort of CSRF enable if (Security::check_token(Input::post('__token'))) { //validate and login } } else { Response::redirect('404'); } } } /* <script> $(document).ready(function(e) { $('.form').on('submit', (function(e){ e.preventDefault(); var formData = new FormData(this); formData.append('__token', fuel_csrf_token()); $.ajax ({ url: $(this).data('uri'), data:formData, cache:false, processData:false, dataType:'json', contentType:false, type:'post', success: function(result) { .... } }); })); }); </script> */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LOOYn
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'controller_promise', 'controller_template'
   14     1        DECLARE_CLASS                                            'controller_home', 'controller_promise'
   28     2        DECLARE_CLASS                                            'controller_auth', 'controller_promise'
   74     3      > RETURN                                                   1

Class Controller_Promise:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LOOYn
function name:  init
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'Auth', 'check'
          1        DO_FCALL                                      0  $0      
          2      > JMPZ                                                     $0, ->9
    8     3    >   INIT_STATIC_METHOD_CALL                                  'Model_User', 'find_by_email'
          4        INIT_STATIC_METHOD_CALL                                  'Auth', 'get_email'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR_NO_REF_EX                                       $1
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
   10     9    > > RETURN                                                   null

End of function init

End of class Controller_Promise.

Class Controller_Home:
Function action_index:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LOOYn
function name:  action_index
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_STATIC_METHOD_CALL                                  'init'
          1        DO_FCALL                                      0  $2      
          2        FETCH_OBJ_W                                      $0      'template'
          3        ASSIGN_OBJ                                               $0, 'user'
          4        OP_DATA                                                  $2
   19     5      > RETURN                                                   null

End of function action_index

Function action_404:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LOOYn
function name:  action_404
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_STATIC_METHOD_CALL                                  'Response', 'forge'
          1        INIT_STATIC_METHOD_CALL                                  'Presenter', 'forge'
          2        SEND_VAL_EX                                              'home%2F404'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR_NO_REF_EX                                       $0
          5        SEND_VAL_EX                                              404
          6        DO_FCALL                                      0  $1      
          7      > RETURN                                                   $1
   24     8*     > RETURN                                                   null

End of function action_404

End of class Controller_Home.

Class Controller_Auth:
Function action_login:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LOOYn
function name:  action_login
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   INIT_STATIC_METHOD_CALL                                  'Input', 'is_ajax'
          1        DO_FCALL                                      0  $0      
          2      > JMPZ                                                     $0, ->11
   35     3    >   INIT_STATIC_METHOD_CALL                                  'Security', 'check_token'
          4        INIT_STATIC_METHOD_CALL                                  'Input', 'post'
          5        SEND_VAL_EX                                              '__token'
          6        DO_FCALL                                      0  $1      
          7        SEND_VAR_NO_REF_EX                                       $1
          8        DO_FCALL                                      0  $2      
          9      > JMPZ                                                     $2, ->10
   32    10    > > JMP                                                      ->14
   40    11    >   INIT_STATIC_METHOD_CALL                                  'Response', 'redirect'
         12        SEND_VAL_EX                                              '404'
         13        DO_FCALL                                      0          
   42    14    > > RETURN                                                   null

End of function action_login

End of class Controller_Auth.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
278.94 ms | 1004 KiB | 13 Q