3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MinLengthValidator implements ValidatorRuleInterface { private string $format = 'Это поле содержит %d символов. Минимальное количество символов для этого поля - %u'; private int $standard; public function __construct (int $standard) { $this->standard = $standard; } public function __invoke(mixed $value): ?ValidationError { $numberOfCharacters = iconv_strlen($value); if ($numberOfCharacters < $this->standard) { return new ValidationError(sprintf($this->format, $numberOfCharacters, $this->standard)); } else { return null; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AePYA
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                                'minlengthvalidator'
   24     1      > RETURN                                                       1

Class MinLengthValidator:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AePYA
function name:  __construct
number of ops:  4
compiled vars:  !0 = $standard
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   11     1        ASSIGN_OBJ                                                   'standard'
          2        OP_DATA                                                      !0
   12     3      > RETURN                                                       null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AePYA
function name:  __invoke
number of ops:  24
compiled vars:  !0 = $value, !1 = $numberOfCharacters
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        INIT_FCALL_BY_NAME                                           'iconv_strlen'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0  $2      
          4        ASSIGN                                                       !1, $2
   18     5        FETCH_OBJ_R                                          ~4      'standard'
          6        IS_SMALLER                                                   !1, ~4
          7      > JMPZ                                                         ~5, ->21
   19     8    >   NEW                                                  $6      'ValidationError'
          9        INIT_FCALL                                                   'sprintf'
         10        FETCH_OBJ_R                                          ~7      'format'
         11        SEND_VAL                                                     ~7
         12        SEND_VAR                                                     !1
         13        FETCH_OBJ_R                                          ~8      'standard'
         14        SEND_VAL                                                     ~8
         15        DO_ICALL                                             $9      
         16        SEND_VAR_NO_REF_EX                                           $9
         17        DO_FCALL                                          0          
         18        VERIFY_RETURN_TYPE                                           $6
         19      > RETURN                                                       $6
   18    20*       JMP                                                          ->22
   21    21    > > RETURN                                                       null
   23    22*       VERIFY_RETURN_TYPE                                           
         23*     > RETURN                                                       null

End of function __invoke

End of class MinLengthValidator.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.92 ms | 1607 KiB | 14 Q