3v4l.org

run code in 500+ PHP versions simultaneously
<?php $corrupted = <<<STRING a:4:{i:0;s:3:"three";i:1;s:5:"five";i:2;s:2:"newline1 newline2";i:3;s:6:"garçon";} STRING; $repaired = preg_replace_callback( '/s:\d+:"(.*?)";/s', function ($m) { return "s:" . strlen($m[1]) . ":\"{$m[1]}\";"; }, $corrupted ); echo $corrupted , "\n" , $repaired; echo "\n---\n"; var_export(unserialize($repaired));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R3MgC
function name:  (null)
number of ops:  19
compiled vars:  !0 = $corrupted, !1 = $repaired
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, 'a%3A4%3A%7Bi%3A0%3Bs%3A3%3A%22three%22%3Bi%3A1%3Bs%3A5%3A%22five%22%3Bi%3A2%3Bs%3A2%3A%22newline1%0Anewline2%22%3Bi%3A3%3Bs%3A6%3A%22gar%C3%A7on%22%3B%7D'
    7     1        INIT_FCALL                                                   'preg_replace_callback'
    8     2        SEND_VAL                                                     '%2Fs%3A%5Cd%2B%3A%22%28.%2A%3F%29%22%3B%2Fs'
    9     3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   11     4        SEND_VAL                                                     ~3
   12     5        SEND_VAR                                                     !0
    7     6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
   15     8        ECHO                                                         !0
          9        ECHO                                                         '%0A'
         10        ECHO                                                         !1
   16    11        ECHO                                                         '%0A---%0A'
   17    12        INIT_FCALL                                                   'var_export'
         13        INIT_FCALL                                                   'unserialize'
         14        SEND_VAR                                                     !1
         15        DO_ICALL                                             $6      
         16        SEND_VAR                                                     $6
         17        DO_ICALL                                                     
         18      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R3MgC
function name:  {closure:/in/R3MgC:9}
number of ops:  11
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
   10     1        FETCH_DIM_R                                          ~1      !0, 1
          2        STRLEN                                               ~2      ~1
          3        CONCAT                                               ~3      's%3A', ~2
          4        ROPE_INIT                                         3  ~6      '%3A%22'
          5        FETCH_DIM_R                                          ~4      !0, 1
          6        ROPE_ADD                                          1  ~6      ~6, ~4
          7        ROPE_END                                          2  ~5      ~6, '%22%3B'
          8        CONCAT                                               ~8      ~3, ~5
          9      > RETURN                                                       ~8
   11    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.19 ms | 2075 KiB | 17 Q