3v4l.org

run code in 300+ PHP versions simultaneously
<?php class IdCardCreator { public function processRequests() { $input = [(object)['tid' => 1, 'facadeFn' => 'idcardcreator.checkLogin']]; $objectResponses = []; foreach ($input as $objectRequest) { $objectResponse = new stdClass(); $objectResponse->tid = $objectRequest->tid; if (isset($objectRequest->facadeFn) && preg_match('~^idcardcreator\.\K\w+$~', $objectRequest->facadeFn, $route) && method_exists($this, $route[0])) { $this->{$route[0]}($objectResponse); } else { $objectResponse->errorMsg = 'Aktion nicht gefunden!'; } $objectResponses[] = $objectResponse; } return $objectResponses; } public function checkLogin(&$objectResponse) { $objectResponse->data = 'something'; } // add all of your methods which are named by facadeFn's trailing term } $card = new IdCardCreator(); var_export($card->processRequests());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VJY1O
function name:  (null)
number of ops:  9
compiled vars:  !0 = $card
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'IdCardCreator'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        INIT_FCALL                                               'var_export'
          4        INIT_METHOD_CALL                                         !0, 'processRequests'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class IdCardCreator:
Function processrequests:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 40
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 40
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 29
Branch analysis from position: 21
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/VJY1O
function name:  processRequests
number of ops:  43
compiled vars:  !0 = $input, !1 = $objectResponses, !2 = $objectRequest, !3 = $objectResponse, !4 = $route
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   CAST                                          8  ~5      <array>
          1        INIT_ARRAY                                       ~6      ~5
          2        ASSIGN                                                   !0, ~6
    7     3        ASSIGN                                                   !1, <array>
    8     4      > FE_RESET_R                                       $9      !0, ->40
          5    > > FE_FETCH_R                                               $9, !2, ->40
    9     6    >   NEW                                              $10     'stdClass'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !3, $10
   10     9        FETCH_OBJ_R                                      ~14     !2, 'tid'
         10        ASSIGN_OBJ                                               !3, 'tid'
         11        OP_DATA                                                  ~14
   11    12        ISSET_ISEMPTY_PROP_OBJ                           ~15     !2, 'facadeFn'
         13      > JMPZ_EX                                          ~15     ~15, ->21
         14    >   INIT_FCALL                                               'preg_match'
         15        SEND_VAL                                                 '%7E%5Eidcardcreator%5C.%5CK%5Cw%2B%24%7E'
         16        FETCH_OBJ_R                                      ~16     !2, 'facadeFn'
         17        SEND_VAL                                                 ~16
         18        SEND_REF                                                 !4
         19        DO_ICALL                                         $17     
         20        BOOL                                             ~15     $17
         21    > > JMPZ_EX                                          ~15     ~15, ->29
         22    >   INIT_FCALL                                               'method_exists'
         23        FETCH_THIS                                       ~18     
         24        SEND_VAL                                                 ~18
         25        FETCH_DIM_R                                      ~19     !4, 0
         26        SEND_VAL                                                 ~19
         27        DO_ICALL                                         $20     
         28        BOOL                                             ~15     $20
         29    > > JMPZ                                                     ~15, ->35
   12    30    >   FETCH_DIM_R                                      ~21     !4, 0
         31        INIT_METHOD_CALL                                         ~21
         32        SEND_VAR_EX                                              !3
         33        DO_FCALL                                      0          
   11    34      > JMP                                                      ->37
   14    35    >   ASSIGN_OBJ                                               !3, 'errorMsg'
         36        OP_DATA                                                  'Aktion+nicht+gefunden%21'
   16    37    >   ASSIGN_DIM                                               !1
         38        OP_DATA                                                  !3
    8    39      > JMP                                                      ->5
         40    >   FE_FREE                                                  $9
   18    41      > RETURN                                                   !1
   19    42*     > RETURN                                                   null

End of function processrequests

Function checklogin:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VJY1O
function name:  checkLogin
number of ops:  4
compiled vars:  !0 = $objectResponse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        ASSIGN_OBJ                                               !0, 'data'
          2        OP_DATA                                                  'something'
   23     3      > RETURN                                                   null

End of function checklogin

End of class IdCardCreator.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.1 ms | 1007 KiB | 16 Q