3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface EventListener { /** * Executes this action. * * @param object $eventObj * @param string $className * @param string $eventName */ public function execute($eventObj, $className, $eventName); } /** * Handles activation of the thank'o'mat in postcreation and editing * * @author Christian "Plunts" Grubert * @copyright 2010 Duetschi Kreativagentur * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package de.wbb3mods.wbb.thankbot */ class ThreadAddFormThankBotListener implements EventListener { const THANKS_AUTOENABLE_NONE = 0; const THANKS_AUTOENABLE_THREAD = 1; const THANKS_AUTOENABLE_ALL = 2; protected $eventObj; protected $className; protected $hasThank = -1; protected $saveThankSetting = false; protected $autoEnableThankomat = -1; /** * @see EventListener::execute() */ public function execute($eventObj, $className, $eventName) { $this->eventObj = $eventObj; $this->className = $className; if ($this->autoEnableThankomat == -1) { $this->autoEnableThankomat = THANKS_AUTOENABLE; if ($this->autoEnableThankomat > 0) { // check if thankomat is only disabled for this forum! if (WCF::getUser()->getPermission('user.board.canActivateThank') && !$this->eventObj->board->getPermission('canActivateThank')) { // global right = true, board right = false $this->autoEnableThankomat = 0; } } if (THANKS_ALLOW_SAVE_AUTOENABLE) { $userOption = WCF::getUser()->autoEnableThankomat; if ($userOption > 0) { $this->autoEnableThankomat = $userOption - 1; } } } switch ($eventName) { case 'readData': $this->readData(); break; case 'readFormParameters': $this->readFormParameters(); break; case 'assignVariables': $this->assignVariables(); break; case 'saved': $this->saved(); break; } } private function checkHasThank() { if ($this->hasThank == -1) { if ($this->autoEnableThankomat == self::THANKS_AUTOENABLE_THREAD && ($this->className == 'ThreadAddForm' || (isset($this->eventObj->post, $this->eventObj->thread) && $this->eventObj->post->postID == $this->eventObj->thread->firstPostID))) $this->hasThank = 1; elseif ($this->autoEnableThankomat == self::THANKS_AUTOENABLE_ALL) $this->hasThank = 1; else $this->hasThank = 0; } } private function readData() { if (!count($_POST)) { $this->hasThank = $this->eventObj->post->hasThank; } } private function readFormParameters() { $this->checkHasThank(); if ($this->eventObj->board->getPermission('canActivateThank') && $this->className != 'PostQuickAddForm') { if (isset($_REQUEST['hasThank'])) $this->hasThank = intval($_REQUEST['hasThank']); else $this->hasThank = 0; } if (isset($_REQUEST['saveThankSetting'])) $this->saveThankSetting = (intval($_REQUEST['saveThankSetting']) != 0); } private function assignVariables() { if (THANKS_FIRSTPOSTONLY && $this->className != 'ThreadAddForm' && (!isset($this->eventObj->postID) || $this->eventObj->postID != $this->eventObj->thread->firstPostID)) { return; } if ($this->eventObj->board->getPermission('canActivateThank')) { $this->checkHasThank(); WCF::getTPL()->assign(array( 'hasThank' => $this->hasThank, 'saveThankSetting' => $this->saveThankSetting, 'autoEnableThankomat' => $this->autoEnableThankomat )); $additionalSettings = WCF::getTPL()->fetch('postThankSetting'); WCF::getTPL()->append(THANKS_POSITION, $additionalSettings); } } private function saved() { if (THANKS_FIRSTPOSTONLY && $this->className != 'ThreadAddForm' && (!isset($this->eventObj->postID) || $this->eventObj->postID != $this->eventObj->thread->firstPostID)) { return; } // Bedanko beim bearbeiten nicht deaktivieren, wenn die Rechte fehlen! if ($this->className == 'PostEditForm' && !$this->eventObj->board->getPermission('canActivateThank')) { return; } $postID = 0; switch ($this->className) { case 'ThreadAddForm': $postID = $this->eventObj->newThread->firstPostID; break; case 'PostAddForm': case 'PostQuickAddForm': $postID = $this->eventObj->newPost->postID; break; case 'PostEditForm': $postID = $this->eventObj->postID; break; } $sql = "UPDATE wbb" . WBB_N . "_post SET hasThank = " . intval($this->hasThank) . " WHERE postID = " . intval($postID); WCF::getDB()->sendQuery($sql); if (THANKS_ALLOW_SAVE_AUTOENABLE && $this->saveThankSetting) { WCF::getUser()->getEditor()->updateOptions(array( 'autoEnableThankomat' => $this->hasThank == 0 ? self::THANKS_AUTOENABLE_NONE + 1 : self::THANKS_AUTOENABLE_ALL + 1 )); } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T9YkI
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   DECLARE_CLASS                                            'threadaddformthankbotlistener'
  158     1      > RETURN                                                   1

Class EventListener:
Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T9YkI
function name:  execute
number of ops:  4
compiled vars:  !0 = $eventObj, !1 = $className, !2 = $eventName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3      > RETURN                                                   null

End of function execute

End of class EventListener.

Class ThreadAddFormThankBotListener:
Function execute:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 43
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
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 = 32
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 43
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 43
Branch analysis from position: 40
6 jumps found. (Code = 188) Position 1 = 53, Position 2 = 56, Position 3 = 59, Position 4 = 62, Position 5 = 65, Position 6 = 44
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 65
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 53
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 56
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 59
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 62
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 62
Branch analysis from position: 59
Branch analysis from position: 56
Branch analysis from position: 53
Branch analysis from position: 43
Branch analysis from position: 43
Branch analysis from position: 32
Branch analysis from position: 29
Branch analysis from position: 32
Branch analysis from position: 43
filename:       /in/T9YkI
function name:  execute
number of ops:  66
compiled vars:  !0 = $eventObj, !1 = $className, !2 = $eventName, !3 = $userOption
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   38     3        ASSIGN_OBJ                                               'eventObj'
          4        OP_DATA                                                  !0
   39     5        ASSIGN_OBJ                                               'className'
          6        OP_DATA                                                  !1
   41     7        FETCH_OBJ_R                                      ~6      'autoEnableThankomat'
          8        IS_EQUAL                                                 ~6, -1
          9      > JMPZ                                                     ~7, ->43
   42    10    >   FETCH_CONSTANT                                   ~9      'THANKS_AUTOENABLE'
         11        ASSIGN_OBJ                                               'autoEnableThankomat'
         12        OP_DATA                                                  ~9
   44    13        FETCH_OBJ_R                                      ~10     'autoEnableThankomat'
         14        IS_SMALLER                                               0, ~10
         15      > JMPZ                                                     ~11, ->32
   46    16    >   INIT_STATIC_METHOD_CALL                                  'WCF', 'getUser'
         17        DO_FCALL                                      0  $12     
         18        INIT_METHOD_CALL                                         $12, 'getPermission'
         19        SEND_VAL_EX                                              'user.board.canActivateThank'
         20        DO_FCALL                                      0  $13     
         21      > JMPZ_EX                                          ~14     $13, ->29
         22    >   FETCH_OBJ_R                                      ~15     'eventObj'
         23        FETCH_OBJ_R                                      ~16     ~15, 'board'
         24        INIT_METHOD_CALL                                         ~16, 'getPermission'
         25        SEND_VAL_EX                                              'canActivateThank'
         26        DO_FCALL                                      0  $17     
         27        BOOL_NOT                                         ~18     $17
         28        BOOL                                             ~14     ~18
         29    > > JMPZ                                                     ~14, ->32
   48    30    >   ASSIGN_OBJ                                               'autoEnableThankomat'
         31        OP_DATA                                                  0
   52    32    >   FETCH_CONSTANT                                   ~20     'THANKS_ALLOW_SAVE_AUTOENABLE'
         33      > JMPZ                                                     ~20, ->43
   53    34    >   INIT_STATIC_METHOD_CALL                                  'WCF', 'getUser'
         35        DO_FCALL                                      0  $21     
         36        FETCH_OBJ_R                                      ~22     $21, 'autoEnableThankomat'
         37        ASSIGN                                                   !3, ~22
   54    38        IS_SMALLER                                               0, !3
         39      > JMPZ                                                     ~24, ->43
   55    40    >   SUB                                              ~26     !3, 1
         41        ASSIGN_OBJ                                               'autoEnableThankomat'
         42        OP_DATA                                                  ~26
   60    43    > > SWITCH_STRING                                            !2, [ 'readData':->53, 'readFormParameters':->56, 'assignVariables':->59, 'saved':->62, ], ->65
   61    44    >   IS_EQUAL                                                 !2, 'readData'
         45      > JMPNZ                                                    ~27, ->53
   64    46    >   IS_EQUAL                                                 !2, 'readFormParameters'
         47      > JMPNZ                                                    ~27, ->56
   67    48    >   IS_EQUAL                                                 !2, 'assignVariables'
         49      > JMPNZ                                                    ~27, ->59
   70    50    >   IS_EQUAL                                                 !2, 'saved'
         51      > JMPNZ                                                    ~27, ->62
         52    > > JMP                                                      ->65
   62    53    >   INIT_METHOD_CALL                                         'readData'
         54        DO_FCALL                                      0          
   63    55      > JMP                                                      ->65
   65    56    >   INIT_METHOD_CALL                                         'readFormParameters'
         57        DO_FCALL                                      0          
   66    58      > JMP                                                      ->65
   68    59    >   INIT_METHOD_CALL                                         'assignVariables'
         60        DO_FCALL                                      0          
   69    61      > JMP                                                      ->65
   71    62    >   INIT_METHOD_CALL                                         'saved'
         63        DO_FCALL                                      0          
   72    64      > JMP                                                      ->65
   74    65    > > RETURN                                                   null

End of function execute

Function checkhasthank:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 38
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 26
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 24
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
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: 30
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 15
Branch analysis from position: 25
Branch analysis from position: 26
Branch analysis from position: 38
filename:       /in/T9YkI
function name:  checkHasThank
number of ops:  39
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   77     0  E >   FETCH_OBJ_R                                      ~0      'hasThank'
          1        IS_EQUAL                                                 ~0, -1
          2      > JMPZ                                                     ~1, ->38
   78     3    >   FETCH_OBJ_R                                      ~2      'autoEnableThankomat'
          4        IS_EQUAL                                         ~3      ~2, 1
          5      > JMPZ_EX                                          ~3      ~3, ->26
          6    >   FETCH_OBJ_R                                      ~4      'className'
          7        IS_EQUAL                                         ~5      ~4, 'ThreadAddForm'
          8      > JMPNZ_EX                                         ~5      ~5, ->25
          9    >   FETCH_OBJ_IS                                     ~6      'eventObj'
         10        ISSET_ISEMPTY_PROP_OBJ                           ~7      ~6, 'post'
         11      > JMPZ_EX                                          ~7      ~7, ->15
         12    >   FETCH_OBJ_IS                                     ~8      'eventObj'
         13        ISSET_ISEMPTY_PROP_OBJ                           ~9      ~8, 'thread'
         14        BOOL                                             ~7      ~9
         15    > > JMPZ_EX                                          ~7      ~7, ->24
         16    >   FETCH_OBJ_R                                      ~10     'eventObj'
         17        FETCH_OBJ_R                                      ~11     ~10, 'post'
         18        FETCH_OBJ_R                                      ~12     ~11, 'postID'
         19        FETCH_OBJ_R                                      ~13     'eventObj'
         20        FETCH_OBJ_R                                      ~14     ~13, 'thread'
         21        FETCH_OBJ_R                                      ~15     ~14, 'firstPostID'
         22        IS_EQUAL                                         ~16     ~12, ~15
         23        BOOL                                             ~7      ~16
         24    >   BOOL                                             ~5      ~7
         25    >   BOOL                                             ~3      ~5
         26    > > JMPZ                                                     ~3, ->30
   79    27    >   ASSIGN_OBJ                                               'hasThank'
         28        OP_DATA                                                  1
         29      > JMP                                                      ->38
   80    30    >   FETCH_OBJ_R                                      ~18     'autoEnableThankomat'
         31        IS_EQUAL                                                 ~18, 2
         32      > JMPZ                                                     ~19, ->36
   81    33    >   ASSIGN_OBJ                                               'hasThank'
         34        OP_DATA                                                  1
         35      > JMP                                                      ->38
   83    36    >   ASSIGN_OBJ                                               'hasThank'
         37        OP_DATA                                                  0
   85    38    > > RETURN                                                   null

End of function checkhasthank

Function readdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/T9YkI
function name:  readData
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   88     0  E >   FETCH_R                      global              ~0      '_POST'
          1        COUNT                                            ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->9
   89     4    >   FETCH_OBJ_R                                      ~4      'eventObj'
          5        FETCH_OBJ_R                                      ~5      ~4, 'post'
          6        FETCH_OBJ_R                                      ~6      ~5, 'hasThank'
          7        ASSIGN_OBJ                                               'hasThank'
          8        OP_DATA                                                  ~6
   91     9    > > RETURN                                                   null

End of function readdata

Function readformparameters:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 23
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
Branch analysis from position: 32
Branch analysis from position: 23
Branch analysis from position: 11
filename:       /in/T9YkI
function name:  readFormParameters
number of ops:  33
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   94     0  E >   INIT_METHOD_CALL                                         'checkHasThank'
          1        DO_FCALL                                      0          
   95     2        FETCH_OBJ_R                                      ~1      'eventObj'
          3        FETCH_OBJ_R                                      ~2      ~1, 'board'
          4        INIT_METHOD_CALL                                         ~2, 'getPermission'
          5        SEND_VAL_EX                                              'canActivateThank'
          6        DO_FCALL                                      0  $3      
          7      > JMPZ_EX                                          ~4      $3, ->11
          8    >   FETCH_OBJ_R                                      ~5      'className'
          9        IS_NOT_EQUAL                                     ~6      ~5, 'PostQuickAddForm'
         10        BOOL                                             ~4      ~6
         11    > > JMPZ                                                     ~4, ->23
   96    12    >   FETCH_IS                                         ~7      '_REQUEST'
         13        ISSET_ISEMPTY_DIM_OBJ                         0          ~7, 'hasThank'
         14      > JMPZ                                                     ~8, ->21
   97    15    >   FETCH_R                      global              ~10     '_REQUEST'
         16        FETCH_DIM_R                                      ~11     ~10, 'hasThank'
         17        CAST                                          4  ~12     ~11
         18        ASSIGN_OBJ                                               'hasThank'
         19        OP_DATA                                                  ~12
         20      > JMP                                                      ->23
   99    21    >   ASSIGN_OBJ                                               'hasThank'
         22        OP_DATA                                                  0
  101    23    >   FETCH_IS                                         ~14     '_REQUEST'
         24        ISSET_ISEMPTY_DIM_OBJ                         0          ~14, 'saveThankSetting'
         25      > JMPZ                                                     ~15, ->32
  102    26    >   FETCH_R                      global              ~17     '_REQUEST'
         27        FETCH_DIM_R                                      ~18     ~17, 'saveThankSetting'
         28        CAST                                          4  ~19     ~18
         29        IS_NOT_EQUAL                                     ~20     ~19, 0
         30        ASSIGN_OBJ                                               'saveThankSetting'
         31        OP_DATA                                                  ~20
  103    32    > > RETURN                                                   null

End of function readformparameters

Function assignvariables:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 52
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
Branch analysis from position: 17
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/T9YkI
function name:  assignVariables
number of ops:  53
compiled vars:  !0 = $additionalSettings
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  106     0  E >   FETCH_CONSTANT                                   ~1      'THANKS_FIRSTPOSTONLY'
          1      > JMPZ_EX                                          ~1      ~1, ->5
          2    >   FETCH_OBJ_R                                      ~2      'className'
          3        IS_NOT_EQUAL                                     ~3      ~2, 'ThreadAddForm'
          4        BOOL                                             ~1      ~3
          5    > > JMPZ_EX                                          ~1      ~1, ->18
          6    >   FETCH_OBJ_IS                                     ~4      'eventObj'
          7        ISSET_ISEMPTY_PROP_OBJ                           ~5      ~4, 'postID'
          8        BOOL_NOT                                         ~6      ~5
          9      > JMPNZ_EX                                         ~6      ~6, ->17
         10    >   FETCH_OBJ_R                                      ~7      'eventObj'
         11        FETCH_OBJ_R                                      ~8      ~7, 'postID'
         12        FETCH_OBJ_R                                      ~9      'eventObj'
         13        FETCH_OBJ_R                                      ~10     ~9, 'thread'
         14        FETCH_OBJ_R                                      ~11     ~10, 'firstPostID'
         15        IS_NOT_EQUAL                                     ~12     ~8, ~11
         16        BOOL                                             ~6      ~12
         17    >   BOOL                                             ~1      ~6
         18    > > JMPZ                                                     ~1, ->20
  107    19    > > RETURN                                                   null
  110    20    >   FETCH_OBJ_R                                      ~13     'eventObj'
         21        FETCH_OBJ_R                                      ~14     ~13, 'board'
         22        INIT_METHOD_CALL                                         ~14, 'getPermission'
         23        SEND_VAL_EX                                              'canActivateThank'
         24        DO_FCALL                                      0  $15     
         25      > JMPZ                                                     $15, ->52
  111    26    >   INIT_METHOD_CALL                                         'checkHasThank'
         27        DO_FCALL                                      0          
  112    28        INIT_STATIC_METHOD_CALL                                  'WCF', 'getTPL'
         29        DO_FCALL                                      0  $17     
         30        INIT_METHOD_CALL                                         $17, 'assign'
  113    31        FETCH_OBJ_R                                      ~18     'hasThank'
         32        INIT_ARRAY                                       ~19     ~18, 'hasThank'
  114    33        FETCH_OBJ_R                                      ~20     'saveThankSetting'
         34        ADD_ARRAY_ELEMENT                                ~19     ~20, 'saveThankSetting'
  115    35        FETCH_OBJ_R                                      ~21     'autoEnableThankomat'
         36        ADD_ARRAY_ELEMENT                                ~19     ~21, 'autoEnableThankomat'
         37        SEND_VAL_EX                                              ~19
         38        DO_FCALL                                      0          
  117    39        INIT_STATIC_METHOD_CALL                                  'WCF', 'getTPL'
         40        DO_FCALL                                      0  $23     
         41        INIT_METHOD_CALL                                         $23, 'fetch'
         42        SEND_VAL_EX                                              'postThankSetting'
         43        DO_FCALL                                      0  $24     
         44        ASSIGN                                                   !0, $24
  118    45        INIT_STATIC_METHOD_CALL                                  'WCF', 'getTPL'
         46        DO_FCALL                                      0  $26     
         47        INIT_METHOD_CALL                                         $26, 'append'
         48        FETCH_CONSTANT                                   ~27     'THANKS_POSITION'
         49        SEND_VAL_EX                                              ~27
         50        SEND_VAR_EX                                              !0
         51        DO_FCALL                                      0          
  120    52    > > RETURN                                                   null

End of function assignvariables

Function saved:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 2, Position 2 = 5
Branch analysis from position: 2
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 32
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
6 jumps found. (Code = 188) Position 1 = 44, Position 2 = 49, Position 3 = 49, Position 4 = 54, Position 5 = 58, Position 6 = 35
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
2 jumps found. (Code = 46) Position 1 = 76, Position 2 = 78
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 93
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 89
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 90
Branch analysis from position: 90
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 93
Branch analysis from position: 78
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 49
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 58
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 44
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 49
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 54
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
Branch analysis from position: 54
Branch analysis from position: 49
Branch analysis from position: 49
Branch analysis from position: 44
Branch analysis from position: 30
Branch analysis from position: 17
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/T9YkI
function name:  saved
number of ops:  94
compiled vars:  !0 = $postID, !1 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  123     0  E >   FETCH_CONSTANT                                   ~2      'THANKS_FIRSTPOSTONLY'
          1      > JMPZ_EX                                          ~2      ~2, ->5
          2    >   FETCH_OBJ_R                                      ~3      'className'
          3        IS_NOT_EQUAL                                     ~4      ~3, 'ThreadAddForm'
          4        BOOL                                             ~2      ~4
          5    > > JMPZ_EX                                          ~2      ~2, ->18
          6    >   FETCH_OBJ_IS                                     ~5      'eventObj'
          7        ISSET_ISEMPTY_PROP_OBJ                           ~6      ~5, 'postID'
          8        BOOL_NOT                                         ~7      ~6
          9      > JMPNZ_EX                                         ~7      ~7, ->17
         10    >   FETCH_OBJ_R                                      ~8      'eventObj'
         11        FETCH_OBJ_R                                      ~9      ~8, 'postID'
         12        FETCH_OBJ_R                                      ~10     'eventObj'
         13        FETCH_OBJ_R                                      ~11     ~10, 'thread'
         14        FETCH_OBJ_R                                      ~12     ~11, 'firstPostID'
         15        IS_NOT_EQUAL                                     ~13     ~9, ~12
         16        BOOL                                             ~7      ~13
         17    >   BOOL                                             ~2      ~7
         18    > > JMPZ                                                     ~2, ->20
  124    19    > > RETURN                                                   null
  128    20    >   FETCH_OBJ_R                                      ~14     'className'
         21        IS_EQUAL                                         ~15     ~14, 'PostEditForm'
         22      > JMPZ_EX                                          ~15     ~15, ->30
         23    >   FETCH_OBJ_R                                      ~16     'eventObj'
         24        FETCH_OBJ_R                                      ~17     ~16, 'board'
         25        INIT_METHOD_CALL                                         ~17, 'getPermission'
         26        SEND_VAL_EX                                              'canActivateThank'
         27        DO_FCALL                                      0  $18     
         28        BOOL_NOT                                         ~19     $18
         29        BOOL                                             ~15     ~19
         30    > > JMPZ                                                     ~15, ->32
  129    31    > > RETURN                                                   null
  132    32    >   ASSIGN                                                   !0, 0
  133    33        FETCH_OBJ_R                                      ~21     'className'
         34      > SWITCH_STRING                                            ~21, [ 'ThreadAddForm':->44, 'PostAddForm':->49, 'PostQuickAddForm':->49, 'PostEditForm':->54, ], ->58
  134    35    >   CASE                                                     ~21, 'ThreadAddForm'
         36      > JMPNZ                                                    ~22, ->44
  137    37    >   CASE                                                     ~21, 'PostAddForm'
         38      > JMPNZ                                                    ~22, ->49
  138    39    >   CASE                                                     ~21, 'PostQuickAddForm'
         40      > JMPNZ                                                    ~22, ->49
  141    41    >   CASE                                                     ~21, 'PostEditForm'
         42      > JMPNZ                                                    ~22, ->54
         43    > > JMP                                                      ->58
  135    44    >   FETCH_OBJ_R                                      ~23     'eventObj'
         45        FETCH_OBJ_R                                      ~24     ~23, 'newThread'
         46        FETCH_OBJ_R                                      ~25     ~24, 'firstPostID'
         47        ASSIGN                                                   !0, ~25
  136    48   

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.62 ms | 1427 KiB | 13 Q