3v4l.org

run code in 500+ PHP versions simultaneously
<?php function cmp_strict(mixed $a, mixed $b): int { if ($a === $b) return 0; $typeA = gettype($a); $typeB = gettype($b); if ($typeA === $typeB) { // abstract function to compare values without type juggling return cmp_values_strict($a, $b); } else { return $typeA <=> $typeB; } } var_dump(cmp_strict(0, '0'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jnLno
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'cmp_strict'
          2        SEND_VAL                                                     0
          3        SEND_VAL                                                     '0'
          4        DO_FCALL                                          0  $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Function cmp_strict:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jnLno
function name:  cmp_strict
number of ops:  23
compiled vars:  !0 = $a, !1 = $b, !2 = $typeA, !3 = $typeB
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    5     2        IS_IDENTICAL                                                 !0, !1
          3      > JMPZ                                                         ~4, ->5
          4    > > RETURN                                                       0
    7     5    >   GET_TYPE                                             ~5      !0
          6        ASSIGN                                                       !2, ~5
    8     7        GET_TYPE                                             ~7      !1
          8        ASSIGN                                                       !3, ~7
    9     9        IS_IDENTICAL                                                 !2, !3
         10      > JMPZ                                                         ~9, ->18
   11    11    >   INIT_FCALL_BY_NAME                                           'cmp_values_strict'
         12        SEND_VAR_EX                                                  !0
         13        SEND_VAR_EX                                                  !1
         14        DO_FCALL                                          0  $10     
         15        VERIFY_RETURN_TYPE                                           $10
         16      > RETURN                                                       $10
    9    17*       JMP                                                          ->21
   13    18    >   SPACESHIP                                            ~11     !2, !3
         19        VERIFY_RETURN_TYPE                                           ~11
         20      > RETURN                                                       ~11
   15    21*       VERIFY_RETURN_TYPE                                           
         22*     > RETURN                                                       null

End of function cmp_strict

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
127.04 ms | 482 KiB | 9 Q