3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Validator { private $rules; private $enrollee; private $detectedValidationErrors; public function __construct($rules, $enrollee, $detectedValidationErrors) { $this->rules = $rules; $this->enrollee = $enrollee; $this->detectedValidationErrors = $detectedValidationErrors; } public function carryOutVerification() { foreach ($this->rules as $key => $value) { foreach ($value as $key1 => $value1) { $result = $value1($this->enrollee->get($key)); if (empty($result)==false) { $errorText = $this->detectedValidationErrors->get($key); $errorText .= $result; $this->detectedValidationErrors->set($key, $errorText); } } } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZ4bH
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E > > RETURN                                                       1

Class Validator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZ4bH
function name:  __construct
number of ops:  10
compiled vars:  !0 = $rules, !1 = $enrollee, !2 = $detectedValidationErrors
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
   13     3        ASSIGN_OBJ                                                   'rules'
          4        OP_DATA                                                      !0
   14     5        ASSIGN_OBJ                                                   'enrollee'
          6        OP_DATA                                                      !1
   15     7        ASSIGN_OBJ                                                   'detectedValidationErrors'
          8        OP_DATA                                                      !2
   16     9      > RETURN                                                       null

End of function __construct

Function carryoutverification:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 32
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 32
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 30
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 30
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 29
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 29
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 30
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/jZ4bH
function name:  carryOutVerification
number of ops:  34
compiled vars:  !0 = $value, !1 = $key, !2 = $value1, !3 = $key1, !4 = $result, !5 = $errorText
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                          ~6      'rules'
          1      > FE_RESET_R                                           $7      ~6, ->32
          2    > > FE_FETCH_R                                           ~8      $7, !0, ->32
          3    >   ASSIGN                                                       !1, ~8
   22     4      > FE_RESET_R                                           $10     !0, ->30
          5    > > FE_FETCH_R                                           ~11     $10, !2, ->30
          6    >   ASSIGN                                                       !3, ~11
   24     7        INIT_DYNAMIC_CALL                                            !2
          8        FETCH_OBJ_R                                          ~13     'enrollee'
          9        INIT_METHOD_CALL                                             ~13, 'get'
         10        SEND_VAR_EX                                                  !1
         11        DO_FCALL                                          0  $14     
         12        SEND_VAR_NO_REF_EX                                           $14
         13        DO_FCALL                                          0  $15     
         14        ASSIGN                                                       !4, $15
   25    15        ISSET_ISEMPTY_CV                                     ~17     !4
         16        IS_EQUAL                                                     ~17, <false>
         17      > JMPZ                                                         ~18, ->29
   26    18    >   FETCH_OBJ_R                                          ~19     'detectedValidationErrors'
         19        INIT_METHOD_CALL                                             ~19, 'get'
         20        SEND_VAR_EX                                                  !1
         21        DO_FCALL                                          0  $20     
         22        ASSIGN                                                       !5, $20
   27    23        ASSIGN_OP                                         8          !5, !4
   28    24        FETCH_OBJ_R                                          ~23     'detectedValidationErrors'
         25        INIT_METHOD_CALL                                             ~23, 'set'
         26        SEND_VAR_EX                                                  !1
         27        SEND_VAR_EX                                                  !5
         28        DO_FCALL                                          0          
   22    29    > > JMP                                                          ->5
         30    >   FE_FREE                                                      $10
   20    31      > JMP                                                          ->2
         32    >   FE_FREE                                                      $7
   32    33      > RETURN                                                       null

End of function carryoutverification

End of class Validator.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.77 ms | 1580 KiB | 13 Q