3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Assert { public static function isString($value) : string { if (false === is_string($value)) { throw new Exception('Not string.'); } return __CLASS__; } public static function notEmptyString($value) : string { if ('' === trim($value)) { throw new DomainException('Empty string.'); } return __CLASS__; } } $string = 'test'; $emptyString = ' '; Assert::isString($string)::notEmptyString($string); Assert::isString($emptyString)::notEmptyString($emptyString);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RdVfs
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $emptyString
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                       !0, 'test'
   24     1        ASSIGN                                                       !1, '++'
   26     2        INIT_STATIC_METHOD_CALL                                      'Assert', 'isString'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $4      
          5        FETCH_CLASS                                       0  $5      $4
          6        INIT_STATIC_METHOD_CALL                                      $5, 'notEmptyString'
          7        SEND_VAR_EX                                                  !0
          8        DO_FCALL                                          0          
   27     9        INIT_STATIC_METHOD_CALL                                      'Assert', 'isString'
         10        SEND_VAR                                                     !1
         11        DO_FCALL                                          0  $7      
         12        FETCH_CLASS                                       0  $8      $7
         13        INIT_STATIC_METHOD_CALL                                      $8, 'notEmptyString'
         14        SEND_VAR_EX                                                  !1
         15        DO_FCALL                                          0          
         16      > RETURN                                                       1

Class Assert:
Function isstring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RdVfs
function name:  isString
number of ops:  11
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    6     1        TYPE_CHECK                                       64  ~1      !0
          2        TYPE_CHECK                                        4          ~1
          3      > JMPZ                                                         ~2, ->8
    7     4    >   NEW                                                  $3      'Exception'
          5        SEND_VAL_EX                                                  'Not+string.'
          6        DO_FCALL                                          0          
          7      > THROW                                             0          $3
   10     8    > > RETURN                                                       'Assert'
   11     9*       VERIFY_RETURN_TYPE                                           
         10*     > RETURN                                                       null

End of function isstring

Function notemptystring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RdVfs
function name:  notEmptyString
number of ops:  11
compiled vars:  !0 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
   15     1        FRAMELESS_ICALL_1                trim                ~1      !0
          2        IS_IDENTICAL                                                 ~1, ''
          3      > JMPZ                                                         ~2, ->8
   16     4    >   NEW                                                  $3      'DomainException'
          5        SEND_VAL_EX                                                  'Empty+string.'
          6        DO_FCALL                                          0          
          7      > THROW                                             0          $3
   19     8    > > RETURN                                                       'Assert'
   20     9*       VERIFY_RETURN_TYPE                                           
         10*     > RETURN                                                       null

End of function notemptystring

End of class Assert.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.98 ms | 1738 KiB | 13 Q