3v4l.org

run code in 300+ PHP versions simultaneously
<?php function noBigInt($json) { $max_int_length = strlen((string) PHP_INT_MAX) - 1; return preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $json); } $json = '{"string":"3 Little Pigs"}'; var_dump(json_decode(noBigInt($json),JSON_NUMERIC_CHECK));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uH9C
function name:  (null)
number of ops:  12
compiled vars:  !0 = $json
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, '%7B%22string%22%3A%223+Little+Pigs%22%7D'
   11     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'json_decode'
          3        INIT_FCALL                                               'nobigint'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        SEND_VAL                                                 32
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function nobigint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uH9C
function name:  noBigInt
number of ops:  14
compiled vars:  !0 = $json, !1 = $max_int_length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        CAST                                          6  ~2      9223372036854775807
          2        STRLEN                                           ~3      ~2
          3        SUB                                              ~4      ~3, 1
          4        ASSIGN                                                   !1, ~4
    6     5        INIT_FCALL                                               'preg_replace'
          6        CONCAT                                           ~6      '%2F%3A%5Cs%2A%28-%3F%5Cd%7B', !1
          7        CONCAT                                           ~7      ~6, '%2C%7D%29%2F'
          8        SEND_VAL                                                 ~7
          9        SEND_VAL                                                 '%3A+%22%241%22'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12      > RETURN                                                   $8
    8    13*     > RETURN                                                   null

End of function nobigint

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.17 ms | 1402 KiB | 20 Q