3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($input) { var_dump(($input >= 0.6 && $input <= 1) ? range ('A', 'D')[(0.999 - $input)*10] : 'F'); } test(0.7); test(1); test(0.6); test(0.5); test(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DQQ25
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 0.7
          2        DO_FCALL                                      0          
    8     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0          
    9     6        INIT_FCALL                                               'test'
          7        SEND_VAL                                                 0.6
          8        DO_FCALL                                      0          
   10     9        INIT_FCALL                                               'test'
         10        SEND_VAL                                                 0.5
         11        DO_FCALL                                      0          
   11    12        INIT_FCALL                                               'test'
         13        SEND_VAL                                                 2
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/DQQ25
function name:  test
number of ops:  20
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        IS_SMALLER_OR_EQUAL                              ~1      0.6, !0
          3      > JMPZ_EX                                          ~1      ~1, ->6
          4    >   IS_SMALLER_OR_EQUAL                              ~2      !0, 1
          5        BOOL                                             ~1      ~2
          6    > > JMPZ                                                     ~1, ->16
          7    >   INIT_FCALL                                               'range'
          8        SEND_VAL                                                 'A'
          9        SEND_VAL                                                 'D'
         10        DO_ICALL                                         $3      
         11        SUB                                              ~4      0.999, !0
         12        MUL                                              ~5      ~4, 10
         13        FETCH_DIM_R                                      ~6      $3, ~5
         14        QM_ASSIGN                                        ~7      ~6
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~7      'F'
         17    >   SEND_VAL                                                 ~7
         18        DO_ICALL                                                 
    5    19      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.38 ms | 1398 KiB | 22 Q