3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ErrorList { private array $listOfAllErrors; public function add (string $fieldName, ValidationError $validationError): void { $this->listOfAllErrors[$fieldName][] = $validationError; } public function getListOfFieldErrors (string $fieldName): array { $result = $this->listOfAllErrors[$fieldName]; foreach ($result as $key => $error) { $result [$key] = $error->get("text"); } return $result; } public function errorListIsEmpty (): bool { return empty($this->listOfAllErrors); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPpGT
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                       1

Class ErrorList:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPpGT
function name:  add
number of ops:  7
compiled vars:  !0 = $fieldName, !1 = $validationError
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    9     2        FETCH_OBJ_W                                          $2      'listOfAllErrors'
          3        FETCH_DIM_W                                          $3      $2, !0
          4        ASSIGN_DIM                                                   $3
          5        OP_DATA                                                      !1
   10     6      > RETURN                                                       null

End of function add

Function getlistoffielderrors:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/HPpGT
function name:  getListOfFieldErrors
number of ops:  18
compiled vars:  !0 = $fieldName, !1 = $result, !2 = $error, !3 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   RECV                                                 !0      
   14     1        FETCH_OBJ_R                                          ~4      'listOfAllErrors'
          2        FETCH_DIM_R                                          ~5      ~4, !0
          3        ASSIGN                                                       !1, ~5
   15     4      > FE_RESET_R                                           $7      !1, ->13
          5    > > FE_FETCH_R                                           ~8      $7, !2, ->13
          6    >   ASSIGN                                                       !3, ~8
   17     7        INIT_METHOD_CALL                                             !2, 'get'
          8        SEND_VAL_EX                                                  'text'
          9        DO_FCALL                                          0  $11     
         10        ASSIGN_DIM                                                   !1, !3
         11        OP_DATA                                                      $11
   15    12      > JMP                                                          ->5
         13    >   FE_FREE                                                      $7
   19    14        VERIFY_RETURN_TYPE                                           !1
         15      > RETURN                                                       !1
   20    16*       VERIFY_RETURN_TYPE                                           
         17*     > RETURN                                                       null

End of function getlistoffielderrors

Function errorlistisempty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HPpGT
function name:  errorListIsEmpty
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   ISSET_ISEMPTY_PROP_OBJ                               ~0      'listOfAllErrors'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   25     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function errorlistisempty

End of class ErrorList.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
154.26 ms | 1580 KiB | 13 Q