3v4l.org

run code in 500+ PHP versions simultaneously
<?php setlocale( LC_NUMERIC, 'de_DE.UTF-8' ); $float = 3.45; echo ' (string) $float => '; var_dump( (string) $float ); // string(4) "3,45" <-- comma in PHP<8 echo 'json_encode( $float ) => '; var_dump( json_encode( $float ) ); // string(4) "3.45" <-- always a period in PHP 7+
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jdDsn
function name:  (null)
number of ops:  18
compiled vars:  !0 = $float
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'setlocale'
          1        SEND_VAL                                                     1
          2        SEND_VAL                                                     'de_DE.UTF-8'
          3        DO_ICALL                                                     
    4     4        ASSIGN                                                       !0, 3.45
    6     5        ECHO                                                         '++++++%28string%29+%24float+%3D%3E+'
    7     6        INIT_FCALL                                                   'var_dump'
          7        CAST                                              6  ~3      !0
          8        SEND_VAL                                                     ~3
          9        DO_ICALL                                                     
    9    10        ECHO                                                         'json_encode%28+%24float+%29+%3D%3E+'
   10    11        INIT_FCALL                                                   'var_dump'
         12        INIT_FCALL                                                   'json_encode'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                             $5      
         15        SEND_VAR                                                     $5
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.04 ms | 3438 KiB | 16 Q