3v4l.org

run code in 300+ 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:  51
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                                  '%00%7Bclosure%7D%2Fin%2FJK901%3A3%240'
          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        INIT_FCALL                                               'in_array'
         13        SEND_VAL                                                 1.7
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
    6    18        INIT_FCALL                                               'array_map'
         19        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJK901%3A6%241'
         20        SEND_VAL                                                 ~8
         21        INIT_FCALL                                               'range'
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 0.9
         24        SEND_VAL                                                 0.1
         25        DO_ICALL                                         $9      
         26        SEND_VAR                                                 $9
         27        DO_ICALL                                         $10     
         28        ASSIGN                                                   !1, $10
    7    29        INIT_FCALL                                               'var_dump'
         30        INIT_FCALL                                               'in_array'
         31        SEND_VAL                                                 0.3
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $12     
         34        SEND_VAR                                                 $12
         35        DO_ICALL                                                 
    8    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'in_array'
         38        SEND_VAL                                                 0.6
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $14     
         41        SEND_VAR                                                 $14
         42        DO_ICALL                                                 
    9    43        INIT_FCALL                                               'var_dump'
         44        INIT_FCALL                                               'in_array'
         45        SEND_VAL                                                 0.7
         46        SEND_VAR                                                 !1
         47        DO_ICALL                                         $16     
         48        SEND_VAR                                                 $16
         49        DO_ICALL                                                 
   11    50      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJK901%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JK901
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FJK901%3A3%240

Function %00%7Bclosure%7D%2Fin%2FJK901%3A6%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JK901
function name:  {closure}
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 function %00%7Bclosure%7D%2Fin%2FJK901%3A6%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.7 ms | 1400 KiB | 23 Q