3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!function_exists('decodeUnits')) { function decodeUnits($unit_str) { if(strlen($unit_str) == 1) { $unit_str = '0'.$unit_str; } if(strlen($unit_str) > 2) { return null; } if($unit_str == '00') { return 'KWh'; } if($unit_str == '07') { return 'Litres'; } if($unit_str == '03') { return 'm3'; } return null; } } decodeUnits("03"); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 6
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/tOreH
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'decodeUnits'
          2        DO_ICALL                                         $0      
          3        BOOL_NOT                                         ~1      $0
          4      > JMPZ                                                     ~1, ->6
    4     5    >   DECLARE_FUNCTION                                         'decodeunits'
   29     6    >   INIT_FCALL_BY_NAME                                       'decodeUnits'
          7        SEND_VAL_EX                                              '03'
          8        DO_FCALL                                      0          
   30     9      > RETURN                                                   1

Function %00decodeunits%2Fin%2FtOreH%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
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
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/tOreH
function name:  decodeUnits
number of ops:  21
compiled vars:  !0 = $unit_str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        STRLEN                                           ~1      !0
          2        IS_EQUAL                                                 ~1, 1
          3      > JMPZ                                                     ~2, ->6
    8     4    >   CONCAT                                           ~3      '0', !0
          5        ASSIGN                                                   !0, ~3
   10     6    >   STRLEN                                           ~5      !0
          7        IS_SMALLER                                               2, ~5
          8      > JMPZ                                                     ~6, ->10
   12     9    > > RETURN                                                   null
   14    10    >   IS_EQUAL                                                 !0, '00'
         11      > JMPZ                                                     ~7, ->13
   16    12    > > RETURN                                                   'KWh'
   18    13    >   IS_EQUAL                                                 !0, '07'
         14      > JMPZ                                                     ~8, ->16
   20    15    > > RETURN                                                   'Litres'
   22    16    >   IS_EQUAL                                                 !0, '03'
         17      > JMPZ                                                     ~9, ->19
   24    18    > > RETURN                                                   'm3'
   26    19    > > RETURN                                                   null
   27    20*     > RETURN                                                   null

End of function %00decodeunits%2Fin%2FtOreH%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.29 ms | 1400 KiB | 15 Q