3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($input) { $foo = range ('A', 'D'); var_dump($foo[(0.999 - $input)*10]); } 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/fFgUW
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 0.7
          2        DO_FCALL                                      0          
    9     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'test'
          7        SEND_VAL                                                 0.6
          8        DO_FCALL                                      0          
   11     9        INIT_FCALL                                               'test'
         10        SEND_VAL                                                 0.5
         11        DO_FCALL                                      0          
   12    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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fFgUW
function name:  test
number of ops:  13
compiled vars:  !0 = $input, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 'A'
          3        SEND_VAL                                                 'D'
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
    5     6        INIT_FCALL                                               'var_dump'
          7        SUB                                              ~4      0.999, !0
          8        MUL                                              ~5      ~4, 10
          9        FETCH_DIM_R                                      ~6      !1, ~5
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                                 
    6    12      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.79 ms | 1399 KiB | 22 Q