3v4l.org

run code in 500+ PHP versions simultaneously
<?php $initial_precision = ini_get('precision'); // JSON echo "JSON\n"; $j = '{ "v": 0.1234567890123456789 }'; echo "precision: " . $initial_precision . "\n"; var_dump(json_encode(json_decode($j))); ini_set('precision', 30); $d = json_decode($j); var_dump(json_encode(json_decode($j))); var_dump($d->v); // SERIALIZE echo "SERIALIZE\n"; $a = 0.1234567890123456789; echo serialize($a) . "\n"; echo "-- UNSERIALIZE\n"; ini_set('precision', $initial_precision); echo "precision: " . ini_get('precision') . "\n"; $s = "d:0.1234567890123456789;"; var_dump(unserialize($s)); // ini precision for var_dump ini_set('precision', 30); echo "precision: " . ini_get('precision') . "\n"; var_dump(unserialize($s)); // serialize precision echo "serialize_precision: " . ini_get('serialize_precision') . "\n"; echo "-- SERIALIZE\n"; echo serialize(unserialize($s)) . "\n"; ini_set('serialize_precision', 30); echo "serialize_precision: " . ini_get('serialize_precision') . "\n"; echo serialize(unserialize($s)) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nb3mE
function name:  (null)
number of ops:  114
compiled vars:  !0 = $initial_precision, !1 = $j, !2 = $d, !3 = $a, !4 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'ini_get'
          1        SEND_VAL                                                     'precision'
          2        DO_ICALL                                             $5      
          3        ASSIGN                                                       !0, $5
    5     4        ECHO                                                         'JSON%0A'
    6     5        ASSIGN                                                       !1, '%7B+%22v%22%3A+0.1234567890123456789+%7D'
    7     6        CONCAT                                               ~8      'precision%3A+', !0
          7        CONCAT                                               ~9      ~8, '%0A'
          8        ECHO                                                         ~9
    8     9        INIT_FCALL                                                   'var_dump'
         10        INIT_FCALL                                                   'json_encode'
         11        INIT_FCALL                                                   'json_decode'
         12        SEND_VAR                                                     !1
         13        DO_ICALL                                             $10     
         14        SEND_VAR                                                     $10
         15        DO_ICALL                                             $11     
         16        SEND_VAR                                                     $11
         17        DO_ICALL                                                     
    9    18        INIT_FCALL                                                   'ini_set'
         19        SEND_VAL                                                     'precision'
         20        SEND_VAL                                                     30
         21        DO_ICALL                                                     
   10    22        INIT_FCALL                                                   'json_decode'
         23        SEND_VAR                                                     !1
         24        DO_ICALL                                             $14     
         25        ASSIGN                                                       !2, $14
   11    26        INIT_FCALL                                                   'var_dump'
         27        INIT_FCALL                                                   'json_encode'
         28        INIT_FCALL                                                   'json_decode'
         29        SEND_VAR                                                     !1
         30        DO_ICALL                                             $16     
         31        SEND_VAR                                                     $16
         32        DO_ICALL                                             $17     
         33        SEND_VAR                                                     $17
         34        DO_ICALL                                                     
   12    35        INIT_FCALL                                                   'var_dump'
         36        FETCH_OBJ_R                                          ~19     !2, 'v'
         37        SEND_VAL                                                     ~19
         38        DO_ICALL                                                     
   15    39        ECHO                                                         'SERIALIZE%0A'
   16    40        ASSIGN                                                       !3, 0.123457
   17    41        INIT_FCALL                                                   'serialize'
         42        SEND_VAR                                                     !3
         43        DO_ICALL                                             $22     
         44        CONCAT                                               ~23     $22, '%0A'
         45        ECHO                                                         ~23
   19    46        ECHO                                                         '--+UNSERIALIZE%0A'
   20    47        INIT_FCALL                                                   'ini_set'
         48        SEND_VAL                                                     'precision'
         49        SEND_VAR                                                     !0
         50        DO_ICALL                                                     
   21    51        INIT_FCALL                                                   'ini_get'
         52        SEND_VAL                                                     'precision'
         53        DO_ICALL                                             $25     
         54        CONCAT                                               ~26     'precision%3A+', $25
         55        CONCAT                                               ~27     ~26, '%0A'
         56        ECHO                                                         ~27
   22    57        ASSIGN                                                       !4, 'd%3A0.1234567890123456789%3B'
   23    58        INIT_FCALL                                                   'var_dump'
         59        INIT_FCALL                                                   'unserialize'
         60        SEND_VAR                                                     !4
         61        DO_ICALL                                             $29     
         62        SEND_VAR                                                     $29
         63        DO_ICALL                                                     
   25    64        INIT_FCALL                                                   'ini_set'
         65        SEND_VAL                                                     'precision'
         66        SEND_VAL                                                     30
         67        DO_ICALL                                                     
   26    68        INIT_FCALL                                                   'ini_get'
         69        SEND_VAL                                                     'precision'
         70        DO_ICALL                                             $32     
         71        CONCAT                                               ~33     'precision%3A+', $32
         72        CONCAT                                               ~34     ~33, '%0A'
         73        ECHO                                                         ~34
   27    74        INIT_FCALL                                                   'var_dump'
         75        INIT_FCALL                                                   'unserialize'
         76        SEND_VAR                                                     !4
         77        DO_ICALL                                             $35     
         78        SEND_VAR                                                     $35
         79        DO_ICALL                                                     
   30    80        INIT_FCALL                                                   'ini_get'
         81        SEND_VAL                                                     'serialize_precision'
         82        DO_ICALL                                             $37     
         83        CONCAT                                               ~38     'serialize_precision%3A+', $37
         84        CONCAT                                               ~39     ~38, '%0A'
         85        ECHO                                                         ~39
   31    86        ECHO                                                         '--+SERIALIZE%0A'
   32    87        INIT_FCALL                                                   'serialize'
         88        INIT_FCALL                                                   'unserialize'
         89        SEND_VAR                                                     !4
         90        DO_ICALL                                             $40     
         91        SEND_VAR                                                     $40
         92        DO_ICALL                                             $41     
         93        CONCAT                                               ~42     $41, '%0A'
         94        ECHO                                                         ~42
   33    95        INIT_FCALL                                                   'ini_set'
         96        SEND_VAL                                                     'serialize_precision'
         97        SEND_VAL                                                     30
         98        DO_ICALL                                                     
   34    99        INIT_FCALL                                                   'ini_get'
        100        SEND_VAL                                                     'serialize_precision'
        101        DO_ICALL                                             $44     
        102        CONCAT                                               ~45     'serialize_precision%3A+', $44
        103        CONCAT                                               ~46     ~45, '%0A'
        104        ECHO                                                         ~46
   35   105        INIT_FCALL                                                   'serialize'
        106        INIT_FCALL                                                   'unserialize'
        107        SEND_VAR                                                     !4
        108        DO_ICALL                                             $47     
        109        SEND_VAR                                                     $47
        110        DO_ICALL                                             $48     
        111        CONCAT                                               ~49     $48, '%0A'
        112        ECHO                                                         ~49
        113      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
186.36 ms | 3467 KiB | 20 Q