3v4l.org

run code in 300+ PHP versions simultaneously
<?php function which_is_lower($a, $b) { if ( $a < $b ) { return $a; } else { return $b; } } echo '-1 vs NULL: min() gives '; var_dump( min(-1, NULL) ); echo '; comparison with < gives '; var_dump( which_is_lower(-1, NULL) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/muEoV
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     '-1+vs+NULL%3A+min%28%29+gives+'
   16     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'min'
          3        SEND_VAL                                                 -1
          4        SEND_VAL                                                 null
          5        DO_ICALL                                         $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                                 
   17     8        ECHO                                                     '%3B+comparison+with+%3C+gives+'
   18     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'which_is_lower'
         11        SEND_VAL                                                 -1
         12        SEND_VAL                                                 null
         13        DO_FCALL                                      0  $2      
         14        SEND_VAR                                                 $2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function which_is_lower:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/muEoV
function name:  which_is_lower
number of ops:  8
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        IS_SMALLER                                               !0, !1
          3      > JMPZ                                                     ~2, ->6
    7     4    > > RETURN                                                   !0
          5*       JMP                                                      ->7
   11     6    > > RETURN                                                   !1
   13     7*     > RETURN                                                   null

End of function which_is_lower

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.09 ms | 1398 KiB | 18 Q