3v4l.org

run code in 500+ PHP versions simultaneously
<?php function getBalanceColor($balance) : string { if($balance <= 0) { return 'red'; } // The OP said 1, but just in case there's fractional let's use 0 if($balance > 0 && $balance <= 5){ return 'yellow'; } return 'green'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8mYiD
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   1

Function getbalancecolor:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/8mYiD
function name:  getBalanceColor
number of ops:  13
compiled vars:  !0 = $balance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        IS_SMALLER_OR_EQUAL                                      !0, 0
          2      > JMPZ                                                     ~1, ->4
    6     3    > > RETURN                                                   'red'
   10     4    >   IS_SMALLER                                       ~2      0, !0
          5      > JMPZ_EX                                          ~2      ~2, ->8
          6    >   IS_SMALLER_OR_EQUAL                              ~3      !0, 5
          7        BOOL                                             ~2      ~3
          8    > > JMPZ                                                     ~2, ->10
   11     9    > > RETURN                                                   'yellow'
   14    10    > > RETURN                                                   'green'
   15    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function getbalancecolor

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.53 ms | 1839 KiB | 13 Q