3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [round(-0.1), round(0.1)]; // [-0,0] var_dump($array); // Array ( [0] => -0 [1] => 0 ) $json = json_encode($array, JSON_PRESERVE_ZERO_FRACTION); // "[-0,0]" $array = json_decode($json); // [0,0] var_dump($array); // Array ( [0] => 0 [1] => 0 )
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1ZRm8
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $json
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'round'
          1        SEND_VAL                                                     -0.1
          2        DO_ICALL                                             $2      
          3        INIT_ARRAY                                           ~3      $2
          4        INIT_FCALL                                                   'round'
          5        SEND_VAL                                                     0.1
          6        DO_ICALL                                             $4      
          7        ADD_ARRAY_ELEMENT                                    ~3      $4
          8        ASSIGN                                                       !0, ~3
    4     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                                     
    5    12        INIT_FCALL                                                   'json_encode'
         13        SEND_VAR                                                     !0
         14        SEND_VAL                                                     1024
         15        DO_ICALL                                             $7      
         16        ASSIGN                                                       !1, $7
    6    17        INIT_FCALL                                                   'json_decode'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $9      
         20        ASSIGN                                                       !0, $9
    7    21        INIT_FCALL                                                   'var_dump'
         22        SEND_VAR                                                     !0
         23        DO_ICALL                                                     
         24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.77 ms | 2123 KiB | 17 Q