3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array_1 = array_map(function($n) { return round($n, 1); }, range(1, 1.9, 0.1)); var_dump(in_array(1.7, $array_1)); $array_2 = array_map(function($n) { return round($n, 1); }, range(0, 0.9, 0.1)); var_dump(in_array(0.3, $array_2)); var_dump(in_array(0.6, $array_2)); var_dump(in_array(0.7, $array_2)); //=>it return false;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JK901
function name:  (null)
number of ops:  39
compiled vars:  !0 = $array_1, !1 = $array_2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'array_map'
          1        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          2        SEND_VAL                                                     ~2
          3        INIT_FCALL                                                   'range'
          4        SEND_VAL                                                     1
          5        SEND_VAL                                                     1.9
          6        SEND_VAL                                                     0.1
          7        DO_ICALL                                             $3      
          8        SEND_VAR                                                     $3
          9        DO_ICALL                                             $4      
         10        ASSIGN                                                       !0, $4
    4    11        INIT_FCALL                                                   'var_dump'
         12        FRAMELESS_ICALL_2                in_array            ~6      1.7, !0
         13        SEND_VAL                                                     ~6
         14        DO_ICALL                                                     
    6    15        INIT_FCALL                                                   'array_map'
         16        DECLARE_LAMBDA_FUNCTION                              ~8      [1]
         17        SEND_VAL                                                     ~8
         18        INIT_FCALL                                                   'range'
         19        SEND_VAL                                                     0
         20        SEND_VAL                                                     0.9
         21        SEND_VAL                                                     0.1
         22        DO_ICALL                                             $9      
         23        SEND_VAR                                                     $9
         24        DO_ICALL                                             $10     
         25        ASSIGN                                                       !1, $10
    7    26        INIT_FCALL                                                   'var_dump'
         27        FRAMELESS_ICALL_2                in_array            ~12     0.3, !1
         28        SEND_VAL                                                     ~12
         29        DO_ICALL                                                     
    8    30        INIT_FCALL                                                   'var_dump'
         31        FRAMELESS_ICALL_2                in_array            ~14     0.6, !1
         32        SEND_VAL                                                     ~14
         33        DO_ICALL                                                     
    9    34        INIT_FCALL                                                   'var_dump'
         35        FRAMELESS_ICALL_2                in_array            ~16     0.7, !1
         36        SEND_VAL                                                     ~16
         37        DO_ICALL                                                     
   11    38      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JK901
function name:  {closure:/in/JK901:3}
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'round'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
          6*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JK901
function name:  {closure:/in/JK901:6}
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'round'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     1
          4        DO_ICALL                                             $1      
          5      > RETURN                                                       $1
          6*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.04 ms | 486 KiB | 11 Q